You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by as <ma...@roomity.com> on 2005/07/30 00:11:30 UTC

Commons Logging

What is the advantage of Commons Logging over Log4j??


--------------------------------------------------------
Mail posted through roomity.com --1122675089947--
--------------------------------------------------------


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


Re: Commons Logging

Posted by Simon Kitching <sk...@apache.org>.
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


RE: Commons Logging

Posted by James Carman <ja...@carmanconsulting.com>.
You can switch to another logging framework if you need to if you use
commons logging.

-----Original Message-----
From: as [mailto:maillist@roomity.com] 
Sent: Friday, July 29, 2005 6:12 PM
To: commons-dev@jakarta.apache.org
Subject: Commons Logging

What is the advantage of Commons Logging over Log4j??


--------------------------------------------------------
Mail posted through roomity.com --1122675089947--
--------------------------------------------------------


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



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