11

Context: JBoss Application Server 6

I am relying on slf4j-jboss-logmanager.jar to bind slf4j to the JBoss log manager.

All logger.info() output is correctly logged.

However, logger.debug() output never appears in the log stream.

Even though jboss-logging.xml has set the level to DEBUG for the CONSOLE logger...

   <console-handler name="CONSOLE" autoflush="true" target="System.out">
      ...
      <level name="DEBUG"/>
      ...
   </console-handler>

Does anybody see why my debug details never reach the log stream?

Jan
  • 9,397
  • 13
  • 47
  • 52

1 Answers1

12

As from JBoss 6, the log manager and jboss-logging.xml are proprietary.

The key is in the root-logger definition at the end of the config file:

The default defintion caps all output to whatever hander at INFO level:

   <root-logger>
      <level name="${jboss.server.log.threshold:INFO}"/>
      <handlers>
         <handler-ref name="CONSOLE"/>
         <handler-ref name="ERROR"/>
         <handler-ref name="FILE"/>
      </handlers>
   </root-logger>

Changing this to

   <root-logger>
      <level name="${jboss.server.log.threshold:DEBUG}"/>
      <handlers>

opens the gate for all possible DEBUG information.

Probably too much DEBUG information. Therefore, I had to add some additional filters:

   <logger category="org.jboss">
      <level name="INFO"/>
   </logger>

   <logger category="org.hibernate">
      <level name="INFO"/>
   </logger>

   <logger category="javax">
      <level name="INFO"/>
   </logger>

   <logger category="idealconnector">
      <level name="INFO"/>
   </logger>

   <logger category="httpclient">
      <level name="INFO"/>
   </logger>

   <logger category="my.package">
      <level name="DEBUG"/>
   </logger>
Jan
  • 9,397
  • 13
  • 47
  • 52
  • 1
    Good to know: Any change to jboss-logging.xml is 'hot deployed' immediately. So it is possible to change the log level of any package/class at any time - in a *running* server (!) – Jan Aug 05 '10 at 21:46
  • A side-note to this if you are running JBOSS with JBOSS-Tools from Eclipse. I did all the stuff mentioned above, but I still did not see the debug statements. The culprit was the launch configuration within eclipse. This referenced the [JBOSS-INSTALL]/bin/logging.properties file which kept the loglevel at INFO. – Bjarne77 Apr 03 '14 at 14:02