On Apr 14, 2009, at 2:02 PM, Jörg Schaible wrote:



2. SLF4J isn't a "direct" replacement for Commons Logging. The APIs
aren't exactly the same.

I thought jcl-over-slf4j (or so) is used for that.

Yes - but you lose a lot of the benefits that SLF4J has when you do that.


My main question stays: What does SLF4J offer that we have to use now for
CC? The last time I've checked (well, it must have been CC 1.3 or so),
logging was used only in one or two places at all anyway.

CC does far too little logging. The code I develop at work uses SLF4J's XLogger to log the major entry and exits so I can easily diagnose problems by watching the method flow along with the input parameters and return values. You don't do this with commons logging because filtering out the noise is somewhat more difficult and doing

static final String methodName = "doSomething";
if (logger.isTracedEnabled())
{
   logger.trace("Entering method" + methodName + ", parm=" + parm);
}

is lots more work than just doing

logger.entry(parm);

I'd be happy to generate some trace logs that show you what this looks like, but you can also see an example by looking at http://www.slf4j.org/extensions.html#extended_logger .




And Rahul's argument about some consistency between the commons component is
also valid, especially now with CC depending (optionally) on VFS ...

On this I totally agree. But to me the question is, "Is it worth it to enhance commons logging to do what SLF4J already does?"

Ralph




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

Reply via email to