cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [RT] Logging in Cocoon
Date Thu, 27 May 2004 13:34:33 GMT
Carsten Ziegeler wrote:

> Marco Rolappe wrote: 
>>why depend explicitly on log4j instead of using 
>>commons-logging? AFAIK when log4j is available 
>>commons-logging automatically uses it before falling back to 
>>JDK logger etc.
> Currently - as we are using Avalon for our components - we use
> an avalon logger which is not directly logging but uses a 
> logging subsystem. This subsystem can be logkit, log4j etc.
> I think commons-logging is possible as well.
> I honestly don't know if it's better to use commons-logging
> or directly use log4j.

If you were to ask the original author of Log4J, the answer is
simple: directly use Log4J.  When I described to him how Avalon
does the abstraction, he said he liked the sound of it better
than the commons logging solution.

What's wrong with commons logging?  Nothing if you have a standalone
application.  However, it uses classpath discovery to determine if
you have LogKit, Log4J, JDK 1.4 logging, and where the logging
configuration file is.  There have been many complaints of inconsistant
configuration of the log files because of the uncertainty of
the servlet classpath.  If the implementers of your servlet engine
inadvertently put a differing implementation than you want to use,
there is a good chance you will be logging to your servlet container's
targets instead of Cocoon's.  Also if you have several instances of
Cocoon under one "webapp" in your ServletContainer you may get some
mixed results.

I don't have all the links right now, but suffice it to say that
Commons Logging uses black magic to set everything up at startup.

View raw message