Enabling DEBUG in JBOSS core

Enable debugging in the JBossTS (Transaction Manager)

Recently, we needed to enable debugging in the JBOSS Transaction core packages.
Here’s how we did it on version 4.3.0 CP06:

  1. Set “com.arjuna.common.util.logging.DebugLevel” in the “common” section of <JBOSS_HOME>/server/<profile>/conf/jbossjta-properties.xml to 0xffffffff
  2. Verify that nothing in <JBOSS_HOME>/server/<profile>/conf/jboss-log4j.xml will prevent DEBUG level messages from “com.arjuna” from reaching the log.
  3. Also add this category to jboss-log4j.xml:
    <category name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">
          <priority value="TRACE"/>
  4. Ensure you haven’t overridden the “THRESHOLD” value in the console appender. If you have remove it. e.g.
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
          <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
          <param name="Target" value="System.out"/>
          <param name="Threshold" value="INFO"/>
          <layout class="org.apache.log4j.PatternLayout">
             <!-- The default pattern: Date Priority [Category] Messagen -->
             <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>

Enable DEBUG to see the sql your EJB CMPs are creating:

  • In the file <JBOSS_HOME>/server/<profile>/conf/jboss-log4j.xml add the following:
    <category name="org.jboss.ejb.plugins.cmp.jdbc">
         <priority value="DEBUG"/>
    	 <appender-ref ref="JDBC"/>
    <appender name="JDBC" class="org.jboss.logging.appender.DailyRollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="File" value="${jboss.server.home.dir}/log/jdbc.log"/> <param name="Append" value="false"/>
    <!-- Rollover at midnight each day --> <param name="DatePattern" value="'.'yyyy-MM-dd"/>
    <!-- Rollover at the top of each hour <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/> -->
    <layout class="org.apache.log4j.PatternLayout"> <!-- The default pattern: Date Priority [Category] Messagen --> <param name="ConversionPattern" value="%d %m%n"/>
    <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Messagen <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> --> </layout> </appender>
  • Search for org.jboss.ejb.plugins.cmp.jdbc and ensure there are no other categories that will conflict with this.

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

1 thought on “Enabling DEBUG in JBOSS core

  1. Pingback: JBoss and log4j | i-Proving –

Leave a Reply