What logging libraries do you recommend as alternatives to Log4j? Do these libraries work with Spring and Hibernate? Are they compatible with Slf4j or Jakarta Commons Logging?
+10
A:
slf4j allows you to use just about all the other logging frameworks at once. Juli, Commons, Log4j etc.. As an output framework to use with slf4j instead of Log4j, I would suggest Logback http://logback.qos.ch/ which is written and maintained by the creator of Log4j.
Mondain
2010-06-15 04:30:27
Can Spring and Hibernate use slf4j with Logback instead of Commons Logging with Log4j?
Derek Mahar
2010-06-15 04:41:18
Yes, we use Spring + SLF4J + Logback in Red5
Mondain
2010-06-15 04:52:00
I'm sure this is more info than you need and it is Red5 specific, but it may help explain what to do:http://www.red5.org/wiki/Documentation/Tutorials/LoggingSetup
Mondain
2010-06-15 04:53:21
Judging from the number of votes for this answer and the absence of any other specific responses, it seems that the combination of slf4j and Logback is now the dominant alternative to Log4j.
Derek Mahar
2010-06-16 16:46:25
@Mondain: I learned that in order to Commons Logging with SLF4J, Spring 2.5.6 requires bridging jarfile `jcl-over-slf4j.jar`. See http://www.slf4j.org/legacy.html#jcl-over-slf4j.
Derek Mahar
2010-06-21 15:38:58
@Mondain: Started using SLF4J and Logback and so far happy with the combination!
Derek Mahar
2010-06-22 08:22:22
@Mondain: Looks like many other Stack Overflow users agree with you: http://stackoverflow.com/questions/178836/should-new-projects-use-logback-instead-of-log4j.
Derek Mahar
2010-06-22 08:28:27