[slf4j-user] SLF4JBridgeHandler performance warning

Ben Pickering benp at causata.com
Mon Apr 12 17:10:49 CEST 2010


Hi

In our application we use several libraries that log using j.u.logging, and
we want to send them to the slf4j-wrapped logback setup we use everywhere
else.  For this we're using the SLF4JBridgeHandler class.

On the Javadoc page for SLF4JBridgeHandler
http://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html there's a
warning that the class comes with a performance cost, and I'm keen to
understand the nature of this.

My assumption is that the issue relates to the case where the j.u.logging
level is finer than the logback level.  Processing done by j.u.logging is
wasted because a logging call never results in a message being written; it
never 'makes it through' logback because of its higher level.  If the
library is generating lots of FINEST calls, this could be a hit.

However, if the j.u.logging level is set high, e.g. to INFO, then
j.u.logging itself never makes the effort, and so there'll be no
additional performance impact.

Is this a correct assessment?  Or is there more that I should be aware of?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20100412/1e0b961b/attachment.html>


More information about the slf4j-user mailing list