You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Hildebrandt, Ole" <ol...@eds.com> on 2004/05/27 14:43:44 UTC

Confusion about Logging

Hi,

I am starting to get a little confused about how to log in Cocoon. Exploring
the WEB-INF/Lib directory I identified these libs having something to do
with logging.

- excalibur-logger-1.0.1.jar
- logfactor5-1.2.8.jar
- logkit-1.2.jar
- commons-logging-1.0.3.jar
- avalon-framework-4.1.4.jar

Now my question is: Which Library/Logging-Framework do I use to log
something from within a native Java-Business-Class? Which one is used by
cocoon itself? How can I define, that the logs from the business-classes
should go into a certain logfile? I am also going to use Hibernate, so I
don't want to have Cocoon, Hibernate and the Business-Java-Classes using
different Logging-Frameworks. Maybe somebody can help me out here or point
me to a nice how-to or tutorial?

Thanks

Ole


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


AW: Confusion about Logging

Posted by Marco Rolappe <m_...@web.de>.
hi ole,

I'd suggest to use commmons-logging. it's a wrapper around the real logging
implementations and if you use it you're not tied to a specific
implementation. it will e.g. automatically use log4j if available and
fallback to e.g. JDK loggin.

cocoon, mainly because of historical reasons (Avalon), uses logkit.

hibernate also uses commons-logging.


your logging configuration (where should the stuff for xyz go, etc.) depends
on which implementation you choose and you should take a look at the
respective documentation.

example config snippet (log4j.properties):

...
### direct messages to file hibernate.log ###
log4j.appender.hibernate=org.apache.log4j.FileAppender
log4j.appender.hibernate.File=hibernate.log
log4j.appender.hibernate.layout=org.apache.log4j.PatternLayout
log4j.appender.hibernate.layout.ConversionPattern=%d %5p %c:%L - %m%n

### set log levels - for more verbose logging change 'info' to 'debug' ##

log4j.logger.net.sf.hibernate=info, hibernate
...

HTH

> -----Ursprüngliche Nachricht-----
> Von: users-return-68091-m_rolappe=web.de@cocoon.apache.org
> [mailto:users-return-68091-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> von Hildebrandt, Ole
> Gesendet: Donnerstag, 27. Mai 2004 14:44
> An: users@cocoon.apache.org
> Betreff: Confusion about Logging
>
>
> Hi,
>
> I am starting to get a little confused about how to log in
> Cocoon. Exploring
> the WEB-INF/Lib directory I identified these libs having something to do
> with logging.
>
> - excalibur-logger-1.0.1.jar
> - logfactor5-1.2.8.jar
> - logkit-1.2.jar
> - commons-logging-1.0.3.jar
> - avalon-framework-4.1.4.jar
>
> Now my question is: Which Library/Logging-Framework do I use to log
> something from within a native Java-Business-Class? Which one is used by
> cocoon itself? How can I define, that the logs from the business-classes
> should go into a certain logfile? I am also going to use Hibernate, so I
> don't want to have Cocoon, Hibernate and the Business-Java-Classes using
> different Logging-Frameworks. Maybe somebody can help me out here or point
> me to a nice how-to or tutorial?
>
> Thanks
>
> Ole
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


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