[logback-user] Confused about jul-to-slf4j bridge and LevelChangePropagator
Kristof Pelckmans
kristof.pelckmans at wondergraphs.com
Thu Dec 30 23:39:12 CET 2010
Hi,
Think I set up the SLF4JBridgeHandler and LevelChangePropagator correctly, since I am now getting all log messages via SLF4J and changes in the level of my root logger are propagated to JUL but I cannot seem to tweak the levels of my JUL loggers:
My configuration file
<configuration>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.google.inject" level="debug" />
<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>
and debug output
23:28:35,723 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
23:28:35,723 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
23:28:35,723 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/.../war/WEB-INF/classes/logback.xml]
23:28:35,763 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
23:28:35,764 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
23:28:35,778 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator at 118cb3a - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
23:28:35,778 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Starting LoggerContextListener
23:28:35,778 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
23:28:35,781 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
23:28:35,787 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
23:28:35,826 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.google.inject] to DEBUG
23:28:35,826 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator at 118cb3a - Propagating DEBUG level on Logger[com.google.inject] onto the JUL framework
23:28:35,826 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
23:28:35,826 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator at 118cb3a - Propagating INFO level on Logger[ROOT] onto the JUL framework
23:28:35,826 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
Although it states "Propagating DEBUG level on Logger[com.google.inject] onto the JUL framework", it does not seem to work.
Moreover, if I manually do
java.util.logging.Logger logger = java.util.logging.Logger.getLogger("com.google.inject");
logger.setLevel(java.util.logging.Level.FINEST);
I do get debug messages!
What am I doing wrong?
Many thanks,
Kristof
More information about the Logback-user
mailing list