Version 22

    Enabling TRACE logging on server

     

    In order to enable TRACE level logging, you need to modify the log4j.xml configuration file of the JBoss server instance running Messaging, as described below.

     

    Normally, log4j.xml changes are picked up by a running JBoss instance and logging is reconfigured dynamically without being necessary to shut it down. This DOES NOT apply to Messaging. For performance reasons, the logging level is cached by JBoss Messaging classes at initialization and it cannot be changed dynamically. In order to change the logging level, you will need to shut down the JBoss server instance, modify log4j.xml and then restart the server.

     

    log4j.xml is located in $JBOSS_HOME/server/messaging/conf.

     

     

    1. Lower FILE appender's logging treshold to TRACE

     

    Add

           <param name="Threshold" value="TRACE#org.jboss.logging.XLevel"/>
    

     

    to your FILE appended configuration.

     

    Also, modify the conversion pattern to include thread information:

     

          <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p @%t [%c{1}] %m%n"/>
          </layout>
    

     

    A typical TRACE-enabled FILE appended configuration should be similar to:

     

       <!-- A time/date based rolling appender -->
       <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
          <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"></errorHandler>
          <param name="File" value="${jboss.server.log.dir}/server.log"/>
          <param name="Append" value="false"/>
          <param name="Threshold" value="TRACE#org.jboss.logging.XLevel"/>
    
          <!-- Rollover at midnight each day -->
          <param name="DatePattern" value="'.'yyyy-MM-dd"/>
    
          <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5r %-5p [%c] @%t %m%n"/>
          </layout>
       </appender>
    

     

     

    2. Enable TRACE logging for org.jboss.jms and org.jboss.messaging

     

    Add the following categories above the <root> element:

     

        <category name="org.jboss.messaging">
          <priority value="TRACE" class="org.jboss.logging.XLevel"></priority>
        </category>
    
        <category name="org.jboss.jms">
          <priority value="TRACE" class="org.jboss.logging.XLevel"></priority>
        </category>
    

     

    3. (Optional) Enable TRACE logging for org.jboss.remoting

     

    If you feel that your problem is related to how messages are marshalled, sent over network and then unmarshalled on the server, it may be a good idea to enable remoting tracing as well, since Messaging uses JBoss Remoting under the cover. However, this is likely to significantly increase the size of your server logs, as they were not big enough already. Your call.

     

    To enable remoting tracing, add the following category:

     

        <category name="org.jboss.remoting">
          <priority value="TRACE" class="org.jboss.logging.XLevel"></priority>
        </category>
    

     

     

     

     

     

    *Warning*

    TRACE logging usually generates hundreds of MBs log files and affects performance, so we strongly recommend to restore the original logging configuration as soon as you take a snapshot of the problem that required lowering the logging threshold.

     

     

     

     

     

     

     

    Referenced by: