added better debug logging

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@574460 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-09-11 05:20:20 +00:00
parent 8e33f646c6
commit 5829d7045c
2 changed files with 12 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);