[logback-dev] [Bug 84] LoggerContextFilter is useless (org.slf4j.Loggerfactory bug ++)

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Tue Sep 18 22:33:49 CEST 2007


http://bugzilla.qos.ch/show_bug.cgi?id=84





------- Comment #2 from noreply.ceki at qos.ch  2007-09-18 22:33 -------
Hello Jens, Lars,

I am confused about this report. We have tested ContextJNDISelector
and it works as it is supposed to. Although there are cases where
ContextJNDISelector does not work, I believe that ContextJNDISelector
works, assuming:

1) logger fields (in shared libraries!) are *not* static

2) logback-core.jar and logback-classic.jar are in tomcat/common/lib
in tomcat (or in a directory on the common class path in other
containers)

In case 1) is not true, then the logger context of first web-app will
win (but only for that logger field and shared library)

Moreover, as you describe in your report, when each web-app provides
its own copy of logback*.jar, then you have separation by virtue of
class loader separation in each web-app (assuming local-first
delegation model as in Tomcat).

I mean no offense but have you read the context selector docs?

  http://logback.qos.ch/manual/contextSelector.html

As for the separation problem in EAR files, again you need to remove
logback-*.jar from the EAR and place them higher up the container class
loader hierarchy. Admittedly, I have not tested logging separation in
EJBs. I am unsure about how to specify the name of the context for
each EJB. If you can pass parameters for the EJB as in web.xml, then
that is the way to go.

Is this any clearer?


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the logback-dev mailing list