[slf4j-user] Per-web-app logging with jars on the server's classpath

Jacob Kjome hoju at visi.com
Tue Mar 20 07:11:42 CET 2007


At 12:59 PM 3/19/2007, you wrote:
 >Mark,
 >
 >At 03:37 PM 3/17/2007, Mark Stralka wrote:
 >
 >>Jake, I did some testing and have determined that logging to separate files
 >>works when I use Log4j.jar directly, but when I use JCL and SLF4j
 >>(jcl104-over-slf4j-1.3.0.jar, slf4j-api-1.3.0.jar, and
 >>slf4j-log4j12-1.3.0.jar),
 >>the log entries only write to appA.log.  This is obviously a problem
 >>because my
 >>real framework extends Spring, which uses JCL internally.
 >
 >[snip]
 >
 >>I'm going to look through SLF4j's implementation of the JCL interfaces to
 >>see if
 >>I can just change the JCL interfaces to use Log4j directly... do you think
 >>that's correct?
 >
 >The factory methods in adaptation layers, such as those in JCL, SLF4J or
 >jcl-over-slf4j, short-circuit the RepositorySelector. You might want to
 >consider a native SLF4J implementations such as logback [1] which
 >incidentally offers a much better alternative to log4j's RepositorySelector
 >in the form of ContextSelector [2].
 >
 >Notwithstanding logback's direct implementation of SLF4J, the JCL or
 >jcl104-over-slf4j adaptation layer will still circumvent your
 >ContextSelector. Practically speaking, with jcl104-over-slf4j as
 >implemented currently, context selection will not work. I will add a bug
 >report so that we can fix this problem in future SLF4J releases.
 >

For reference, here's the report...
http://bugzilla.slf4j.org/show_bug.cgi?id=43

Yikes.  Was this an oversight or a known 
limitation that was put off for later given other 
priorities?  Given the push to use SLF4J instead 
of directly referencing logging implementations, 
this is a pretty big oversight, no?  I guess it 
could be argued that the number of people 
actually using repository selectors or context 
selectors is relatively low, but maybe that's 
because people keep running into roadblocks such as this?

What kind of effort is needed to correct this issue?  Any time frame?

Jake

 >HTH,
 >
 >[1] http://logback.qos.ch/
 >[2] http://logback.qos.ch/manual/contextSelector.html
 >
 >
 >--
 >Ceki Gülcü
 >Logback: The reliable, generic, fast and flexible logging framework for Java.
 >http://logback.qos.ch
 >
 >_______________________________________________
 >user mailing list
 >user at slf4j.org
 >http://www.slf4j.org/mailman/listinfo/user




More information about the slf4j-user mailing list