diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java index 86703c470a..e151bc4ca1 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java @@ -413,7 +413,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC return null; } else if (md.getMessage().isExpired()) { if (LOG.isDebugEnabled()) { - LOG.debug("Received expired message: " + md); + LOG.debug(getConsumerId() + " received expired message: " + md); } beforeMessageIsConsumed(md); afterMessageIsConsumed(md, true); @@ -422,7 +422,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC } } else { if (LOG.isDebugEnabled()) { - LOG.debug("Received message: " + md); + LOG.debug(getConsumerId() + " received message: " + md); } return md; } @@ -613,7 +613,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC try { session.asyncSendPacket(ackToSend); } catch (JMSException e) { - LOG.error("Failed to delivered acknowledgements", e); + LOG.error(getConsumerId() + " failed to delivered acknowledgements", e); } finally { deliveryingAcknowledgements.set(false); } @@ -940,7 +940,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC // next message. afterMessageIsConsumed(md, false); } - LOG.error("Exception while processing message: " + e, e); + LOG.error(getConsumerId() + " Exception while processing message: " + e, e); } } else { unconsumedMessages.enqueue(md); @@ -951,7 +951,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC } else { // ignore duplicate if (LOG.isDebugEnabled()) { - LOG.debug("Ignoring Duplicate: " + md.getMessage()); + LOG.debug(getConsumerId() + " Ignoring Duplicate: " + md.getMessage()); } ackLater(md, MessageAck.STANDARD_ACK_TYPE); } diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java index e3910506e2..879363f9e8 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java @@ -488,6 +488,9 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta if (!getTransacted()) { throw new javax.jms.IllegalStateException("Not a transacted session"); } + if (LOG.isDebugEnabled()) { + LOG.debug(getSessionId() + " Transaction Commit"); + } transactionContext.commit(); } @@ -505,6 +508,9 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta if (!getTransacted()) { throw new javax.jms.IllegalStateException("Not a transacted session"); } + if (LOG.isDebugEnabled()) { + LOG.debug(getSessionId() + " Transaction Rollback"); + } transactionContext.rollback(); } @@ -1610,7 +1616,7 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta msg.onSend(); msg.setProducerId(msg.getMessageId().getProducerId()); if (this.debug) { - LOG.debug("Sending message: " + msg); + LOG.debug(getSessionId() + " sending message: " + msg); } if (!connection.isAlwaysSyncSend() && (!msg.isPersistent() || connection.isUseAsyncSend() || txid != null)) { this.connection.asyncSendPacket(msg);