My web application (deployed on tomcat 7) is using hibernate 4.2 which logs using jboss-logging. Jboss logging is finding slf4j on the path and uses it. In turn, I have logback-classic to output the logs. Everything works nicely, but I cannot customize the root logging level, i.e.
<logger name="o.h.cfg.annotations" level="info"/>
<logger name="rest.helpers" level="info"/>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
Results in:
logback-test 16:47:03.689 [http-bio-8080-exec-5] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
logback-test 16:47:04.244 [http-bio-8080-exec-5] DEBUG o.h.cfg.annotations.EntityBinder
logback-test 10:00:11.911 [localhost-startStop-1] INFO rest.helpers.MyApplication
For messages coming from jboss (o.h.cfg.annotations.*), level is set to info, but a debug message is printed. When I use slf4j directly (rest.helpers.*), it correctly filters out my debug messages, and prints my info messages.
Now, if root log level is set to "none", allowing some debug messages will print all of them:
<logger name="o.h.cfg.annotations" level="debug"/>
<logger name="rest.helpers" level="debug"/>
<root level="none"/>
logback-test 10:22:25.926 [localhost-startStop-1] DEBUG rest.helpers.MyApplication -dMyApplication() Aug 2, 2013 10:22:26 AM org.glassfish.jersey.server.ApplicationHandler initialize INFO: Initiating Jersey application
logback-test 10:22:26.253 [localhost-startStop-1] INFO rest.helpers.MyApplication
logback-test 10:22:42.995 [http-bio-8080-exec-5] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
logback-test 10:22:43.025 [http-bio-8080-exec-5] DEBUG org.hibernate.type.BasicTypeRegistry
I have not allowed org.hibernate debug messages, why did they appear? i verified that the right config file is taken (by changing the log format)
Please help me make sense of this.
My classpath contains
- slf4j-api 1.6.1
- jul-to-slf4j 1.6.1
- log4j-over-slf4j 1.6.1
- logback-core 1.0.33
- logback-classic 1.0.33
- jboss-logging 3.1.0.GA.
Both logback.xml and logback-test.xml are in the classpath. logback.xml contains <root level="warn">
and no further specialization