[jbpm-commits] JBoss JBPM SVN: r6696 - jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/ejb.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 28 16:45:00 EDT 2010


Author: bradsdavis
Date: 2010-09-28 16:44:59 -0400 (Tue, 28 Sep 2010)
New Revision: 6696

Modified:
   jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/ejb/CommandListenerBean.java
Log:
Reflect the Command object and the Message ID to the logs in debug mode for tracability.

Modified: jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/ejb/CommandListenerBean.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/ejb/CommandListenerBean.java	2010-09-28 15:56:33 UTC (rev 6695)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/ejb/CommandListenerBean.java	2010-09-28 20:44:59 UTC (rev 6696)
@@ -38,6 +38,7 @@
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
 
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jbpm.command.Command;
@@ -109,15 +110,18 @@
       // execute command via local command executor bean
       Object result;
       try {
-        result = commandService.execute(command);
+    	  if(log.isDebugEnabled()) {
+    		  log.debug("Command: "+ReflectionToStringBuilder.toString(command)+" sent with Message["+message.toString()+"]");
+    	  }
+    	  result = commandService.execute(command);
       }
       catch (RuntimeException e) {
         // if this is a locking exception, keep it quiet
         if (DbPersistenceService.isLockingException(e)) {
-          StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error("failed to execute " + command, e);
+          StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error(message.toString()+"failed to execute " + command, e);
         }
         else {
-          log.error("failed to execute " + command, e);
+          log.error(message.toString()+" failed to execute " + command, e);
         }
         // MDBs are not supposed to throw exceptions
         messageDrivenContext.setRollbackOnly();



More information about the jbpm-commits mailing list