2 Replies Latest reply on Aug 14, 2009 5:16 AM by asookazian

    TxConnectionManager and enabling trace level logging

    asookazian

      I am trying to debug and understand how the TxConnectionManager enlists XA resources for a 2PC/XA tx.

      I would like to know how to get the trace variable to be true below:

      public boolean enlist()
       {
       if (trace)
       log.trace("Enlisting resource " + TxConnectionEventListener.this);
       try
       {
       XAResource resource = getXAResource();
       if (false == currentTx.enlistResource(resource))
       enlistError = FAILED_TO_ENLIST;
       }
       catch (Throwable t)
       {
       enlistError = t;
       }
      
       synchronized (this)
       {
       if (enlistError != null)
       {
       if (trace)
       log.trace("Failed to enlist resource " + TxConnectionEventListener.this, enlistError);
       setTrackByTx(false);
       transactionSynchronization = null;
       return false;
       }
      
       if (trace)
       log.trace("Enlisted resource " + TxConnectionEventListener.this);
       enlisted = true;
       return true;
       }
       }


      The log is set in an ancestor class - ServiceMBeanSupport in the constructor:

      public ServiceMBeanSupport()
       {
       // can not call this(Class) because we need to call getClass()
       this.log = Logger.getLogger(getClass().getName());
       log.trace("Constructing");
       }


      And the trace variable is set in another ancestor class - BaseConnectionManager2:

      public BaseConnectionManager2()
       {
       super();
       trace = log.isTraceEnabled();
       }


      But I tried several things in the jboss-log4j.xml file and it doesn't work (i.e. I don't see the trace level logging).

      I tried:

      <root>
       <priority value="TRACE" />
       <appender-ref ref="CONSOLE"/>
       <appender-ref ref="FILE"/>
       <appender-ref ref="SMTP"/>
       </root>


      and this:

      <!-- Limit JBoss categories -->
       <category name="org.jboss.system">
       <priority value="TRACE"/>
       </category>


      and even this:
      <!-- Limit JBoss categories -->
       <category name="org.jboss">
       <priority value="TRACE"/>
       </category>


      How can I achieve this? thx.