commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: Commons Logging
Date Sat, 30 Jul 2005 00:01:56 GMT
On Fri, 2005-07-29 at 15:11 -0700, as wrote:
> What is the advantage of Commons Logging over Log4j??

This question really belongs on the user list, not the dev list.

However as you've asked it...

Commons-logging is very important when writing libraries that might be
used in other projects. If the library codes directly to log4j, but the
application it is using some other logging library then there is a
problem. However if the library is using commons-logging then
commons-logging just auto-detects what real logging lib is used in the
surrounding application and adapts to it (or manual config can be used
to override the auto-detection) so that the libraries' output and the
application's output is all nicely unified.

Commons-logging can be useful when you are writing an application but
want to allow the person installing your app to choose what logging lib
to use. Apache Tomcat does this; the person installing it can choose to
use log4j, java.util.logging, etc. However I'm not personally persuaded
this is a very useful feature.

Commons-logging *can* also be useful when you are writing an application
but want to reserve the right to swap logging libraries at a later date.
This is not so important, though, as it really isn't that hard to use
some refactoring tool or a few scripts to change source code from using
library X to library Y.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message