[jboss-user] [EJB/JBoss] - TxConnectionManager and enabling trace level logging

asookazian do-not-reply at jboss.com
Thu Aug 13 19:58:08 EDT 2009


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.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249542#4249542

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249542



More information about the jboss-user mailing list