You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jakob Fix <ja...@gmail.com> on 2006/01/19 16:14:48 UTC

configuring Cocoon's logkit for console logging only

Hello,

I have trouble configuring logkit as to not log to file at all (the
application will run directly from CD-ROM), but to only log
FATAL_ERRORs to the *console*.  I can't find any hint as to what the
name of the factory to use would be.

Any help is greatly appreciated.
--
cheers,
Jakob.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Jakob Fix <ja...@gmail.com>.
Giacomo,

On 20/01/06, Giacomo Pati <gi...@apache.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, 20 Jan 2006, Jakob Fix wrote:
>
> > Googling for "stream target cocoon", at
> > http://www.planetcocoon.com/tags/210 I found  "Re: svn commit: r159493
> > - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf"
> >
> > which contained the line
> >
> > +    <factory type="stream"
> > class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
> >
> > which I then used in my <factories> section.
> >
> > Then I cut down the <targets> section to this:
> >
> > <targets>
> >  <stream id="console"/>
> > </targets>
> >
> > Again, I deduced from looking at the factory elements' type attribute
> > that they probably woud be the namesake for the target element name. I
> > gave it the id attribute value "console" because you alluded to it in
> > your previous post.  And then I replaced, as you indicated, all id-ref
> > values with "console".  Also, as I mentioned, the error level is
> > pushed up to FATAL_ERROR.
> >
> > Thanks for the pointer to the stream factory though.
>
> Your factory setting is ok. In the <targets> you should have:
>
>
>      <stream id="console">
>        <stream>System.out</stream>
>        <format type="extended">%5.5{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n</format>
>      </stream>
>
> And in the <categories>
>
>      <category log-level="FATAL_ERROR" name="">
>        <log-target id-ref="console"/>
>      </category>
>
> HTH

yes it does.  Thanks for this additional information.
--
cheers,
Jakob.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 20 Jan 2006, Jakob Fix wrote:

> Googling for "stream target cocoon", at
> http://www.planetcocoon.com/tags/210 I found  "Re: svn commit: r159493
> - cocoon/trunk/src/webapp/WEB-INF/logkit.xconf"
>
> which contained the line
>
> +    <factory type="stream"
> class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
>
> which I then used in my <factories> section.
>
> Then I cut down the <targets> section to this:
>
> <targets>
>  <stream id="console"/>
> </targets>
>
> Again, I deduced from looking at the factory elements' type attribute
> that they probably woud be the namesake for the target element name. I
> gave it the id attribute value "console" because you alluded to it in
> your previous post.  And then I replaced, as you indicated, all id-ref
> values with "console".  Also, as I mentioned, the error level is
> pushed up to FATAL_ERROR.
>
> Thanks for the pointer to the stream factory though.

Your factory setting is ok. In the <targets> you should have:


     <stream id="console">
       <stream>System.out</stream>
       <format type="extended">%5.5{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n</format>
     </stream>

And in the <categories>

     <category log-level="FATAL_ERROR" name="">
       <log-target id-ref="console"/>
     </category>

HTH

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD0VEhLNdJvZjjVZARAvDXAKC8PKAOOuYF4PoUI2ZQOdhf5ljYiQCfbiz7
AAY+k2bQVCES8sIHPpzTGfU=
=NeTA
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Jakob Fix <ja...@gmail.com>.
Hello again,

OK, I've found the solution.  Probably should have done some more
research ... but in my defense, it's really not easy to find
documentation on Cocoon and its assorted technologies.

On 20/01/06, Jakob Fix <ja...@gmail.com> wrote:
> Hi Giacomo,
>
> thanks for your reply.
>
> On 20/01/06, Giacomo Pati <gi...@apache.org> wrote:
> > > From: Jakob Fix <ja...@gmail.com>
> > > I have trouble configuring logkit as to not log to file at all (the
> > > application will run directly from CD-ROM), but to only log
> > > FATAL_ERRORs to the *console*.  I can't find any hint as to what the
> > > name of the factory to use would be.
> >
> > Change all ref-id attribute values in the <categories> section of the
> > logkit.xml file to "console" and you are done ("console" references the
> > corresponding <stream id="console"> target in the <targets> section
> > which uses the "stream" factory which prints to System.out).
>
> OK, I can change the ref-id attributes to "console".
>
> However, I do not have any <stream> elements in my <targets> section,
> and also there's no stream factory, just these:
>
> <factory type="priority-filter"
>   class="org.apache.avalon.excalibur.logger.factory.PriorityFilterTargetFactory"/>
> <factory type="servlet"
>   class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
> <factory type="cocoon" class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
> <factory type="lf5"
> class="org.apache.avalon.excalibur.logger.factory.LF5TargetFactory"/>
>
> Couldn't find any mentioning of a stream factory etc. on the cocoon
> website either.  I'm using 2.1.5.
>
> Is it just me being daft?
>
> --
> cheers,
> Jakob.

Googling for "stream target cocoon", at
http://www.planetcocoon.com/tags/210 I found  "Re: svn commit: r159493
- cocoon/trunk/src/webapp/WEB-INF/logkit.xconf"

which contained the line

+    <factory type="stream"
class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>

which I then used in my <factories> section.

Then I cut down the <targets> section to this:

<targets>
  <stream id="console"/>	
</targets>

Again, I deduced from looking at the factory elements' type attribute
that they probably woud be the namesake for the target element name. I
gave it the id attribute value "console" because you alluded to it in
your previous post.  And then I replaced, as you indicated, all id-ref
values with "console".  Also, as I mentioned, the error level is
pushed up to FATAL_ERROR.

Thanks for the pointer to the stream factory though.

--
cheers,
Jakob.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 20 Jan 2006, Jakob Fix wrote:

> Date: Fri, 20 Jan 2006 10:51:58 +0100
> From: Jakob Fix <ja...@gmail.com>
> Reply-To: users@cocoon.apache.org
> To: users@cocoon.apache.org
> Subject: Re: configuring Cocoon's logkit for console logging only
> 
> Hi Giacomo,
>
> thanks for your reply.
>
> On 20/01/06, Giacomo Pati <gi...@apache.org> wrote:
>>> From: Jakob Fix <ja...@gmail.com>
>>> I have trouble configuring logkit as to not log to file at all (the
>>> application will run directly from CD-ROM), but to only log
>>> FATAL_ERRORs to the *console*.  I can't find any hint as to what the
>>> name of the factory to use would be.
>>
>> Change all ref-id attribute values in the <categories> section of the
>> logkit.xml file to "console" and you are done ("console" references the
>> corresponding <stream id="console"> target in the <targets> section
>> which uses the "stream" factory which prints to System.out).
>
> OK, I can change the ref-id attributes to "console".
>
> However, I do not have any <stream> elements in my <targets> section,
> and also there's no stream factory, just these:
>
> <factory type="priority-filter"
>  class="org.apache.avalon.excalibur.logger.factory.PriorityFilterTargetFactory"/>
> <factory type="servlet"
>  class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
> <factory type="cocoon" class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
> <factory type="lf5"
> class="org.apache.avalon.excalibur.logger.factory.LF5TargetFactory"/>
>
> Couldn't find any mentioning of a stream factory etc. on the cocoon
> website either.  I'm using 2.1.5.

Uh! 2.1.5, long time ago, don't know whether you can use a more recent 
logkit.xml. Just try the 2.1.8 one.

>
> Is it just me being daft?
>
> --
> cheers,
> Jakob.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD0VACLNdJvZjjVZARAusDAKDC3gHOzhMS5elOiO1pTa5Hf4CrHwCguTEe
dr62cV66Xh3gjhXIRwwy88U=
=dwPN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Jakob Fix <ja...@gmail.com>.
Hi Giacomo,

thanks for your reply.

On 20/01/06, Giacomo Pati <gi...@apache.org> wrote:
> > From: Jakob Fix <ja...@gmail.com>
> > I have trouble configuring logkit as to not log to file at all (the
> > application will run directly from CD-ROM), but to only log
> > FATAL_ERRORs to the *console*.  I can't find any hint as to what the
> > name of the factory to use would be.
>
> Change all ref-id attribute values in the <categories> section of the
> logkit.xml file to "console" and you are done ("console" references the
> corresponding <stream id="console"> target in the <targets> section
> which uses the "stream" factory which prints to System.out).

OK, I can change the ref-id attributes to "console".

However, I do not have any <stream> elements in my <targets> section,
and also there's no stream factory, just these:

<factory type="priority-filter"
  class="org.apache.avalon.excalibur.logger.factory.PriorityFilterTargetFactory"/>
<factory type="servlet"
  class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory"/>
<factory type="cocoon" class="org.apache.cocoon.util.log.CocoonTargetFactory"/>
<factory type="lf5"
class="org.apache.avalon.excalibur.logger.factory.LF5TargetFactory"/>

Couldn't find any mentioning of a stream factory etc. on the cocoon
website either.  I'm using 2.1.5.

Is it just me being daft?

--
cheers,
Jakob.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: configuring Cocoon's logkit for console logging only

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 19 Jan 2006, Jakob Fix wrote:

> Date: Thu, 19 Jan 2006 16:14:48 +0100
> From: Jakob Fix <ja...@gmail.com>
> Reply-To: users@cocoon.apache.org
> To: users@cocoon.apache.org
> Subject: configuring Cocoon's logkit for console logging only
> 
> Hello,
>
> I have trouble configuring logkit as to not log to file at all (the
> application will run directly from CD-ROM), but to only log
> FATAL_ERRORs to the *console*.  I can't find any hint as to what the
> name of the factory to use would be.

Change all ref-id attribute values in the <categories> section of the 
logkit.xml file to "console" and you are done ("console" references the 
corresponding <stream id="console"> target in the <targets> section 
which uses the "stream" factory which prints to System.out).

HTH

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD0KRsLNdJvZjjVZARAhZtAJ4gnudhYy0aFDAcZUcnXt8Q9dtbLQCg6qK3
2w/ofb062igqKSuBVnxcgeY=
=2e7N
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org