codahale/dropwizard — pull request #99 by christophercurrie (2012-05-24 19:02:01+00:00)
Title: Propagate log level changes to JUL

`SLF4JBridgeHandler` only sees logs that are actually emitted by `java.util.logging`, and the default logging level for JUL is `INFO`. Because of this, no matter how verbose the Dropwizard logging level is set, it won't get those messages unless the JUL logger is also set to the same level or lower.

Two approaches to this are possible.

1. Set the Level for the root JUL Logger to `ALL`. This is the simplest approach, but has an overhead cost for processing log messages that are not emitted by Logback. This cost is further discussed in the [slf4j docs](http://www.slf4j.org/legacy.html#jul-to-slf4j).

2. Add an instance of `ch.qos.logback.classic.jul.LevelChangePropagator` to the `LoggerContext`. This class listens for logger level changes and makes an equivalent change happen on the JUL Logger with the same name.

This patch takes the second approach. Unfortunately, since the listener needs to be added *after* the LoggerContext is reset, but *before* the logging levels are configured, the patch changes `configureLevels` instead of `hijackJDKLogging`. Let me know if you rather I refactor the logging configuration to make this cleaner.