[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] hide slf4j classes from web-apps
|
You could try to move all logging classes out of /lib and put them in
/WEB-INF/lib. This may not work, though, because it's likely that slf4j
does all its binding work statically on startup.
On 1/2/2013 11:57 PM, psfung wrote:
I use slf4j with log4j for Jetty (8.1.8) server logs. I follow
http://wiki.eclipse.org/Jetty/Reference/Jetty_Classloading and add
slf4j-api-1.6.6.jar, slf4j-log4j12-1.6.6.jar and log4j-1.2.17.jar in
lib/ext. It works fine.
I'd like to allow web-apps to have different slf4j bindings, so I've added
the following to hide slf4j and log4j classes from web-apps:
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="addServerClass">
<Arg type="String">org.slf4j.</Arg>
</Call>
<Call name="addServerClass">
<Arg type="String">org.apache.log4j.</Arg>
</Call>
</Configure>
But I still see warning in stderr:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/C:/jetty/webapps/CUI/WEB-INF/lib/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/C:/jetty/lib/ext/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
What else should I do?
--
View this message in context: http://jetty.4.n6.nabble.com/hide-slf4j-classes-from-web-apps-tp4959778.html
Sent from the Jetty User mailing list archive at Nabble.com.