Skip to main content

[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 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 name="addServerClass">
     <Arg type="String">org.apache.log4j.</Arg>

But I still see warning in stderr:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
SLF4J: Found binding in

What else should I do?

View this message in context:
Sent from the Jetty User mailing list archive at

Back to the top