views:

171

answers:

3

I'm looking for more current recommendations on the JCL. I need to choose between using the JCL or just using straight Log4j. I can see the benefits of JCL, but articles such as http://www.qos.ch/logging/thinkAgain.jsp leave me a little unsettled. However, these articles are a bit old and a search of JCL bug fixes seems to indicate some of these issues may have been resolved. I am hoping for a more recent take on the issue. Any thoughts?

+1  A: 

Check out Simple Logging Facade for Java (SLF4J). The article you referenced talks about the "classloader problem" and SLF4J is supposed to answer that.

jdigital
+2  A: 

Well, this is not a direct answer to you, but I strongly recommend using Simple Logging Facade for Java (SLF4J) with Logback implementation. Logback project is meant to be a successor of Log4j project, and is built by the founder of Log4j and the author of the mentioned article.

SLF4j provides a clean interface to the various logging tools, with adaptors for legacy logging tools. This helpful when you rely on packages that rely on log4j and/or JDK logger.

A previous question discussed some of the reasons to use SLF4J project.

notnoop
I was looking at and interested in SLF4J, but, unfortunately, it is not an option at this point. There is far too much bureaucracy that we would have to go through to get it approved (legal, FOSS review, security review, etc.) and our schedule doesn't allow it. Basically, I am have to choose between System.out.println, Log4j, or JCL. We are technically bound by a coding standard that says to use the JCL, but I think we could successfully argue our way out of that one...
Adam
+1  A: 

Unless you need to support something older than java 1.4, consider just using java.util.logging. Standard is better than better, and this way you won't have any classloader problems at all.

Sean Reilly
Standard is better than "better", unless the "better" is way better than the standard!
notnoop