From 78f85ed277d639bbe48eab9e7ed8a22fb09e84c6 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 4 Mar 2011 11:46:39 +0000 Subject: [PATCH] further reduction in stack traces at warn level in log for STOMP, suppress to stack trace to debug level, better for authorized broker git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1077889 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/TransportConnection.java | 2 +- .../apache/activemq/transport/stomp/ProtocolConverter.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java index 1c580ad369..1eeb398c06 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java @@ -697,7 +697,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor { brokerConnectionStates.remove(info); LOG.warn("Failed to add Connection, reason: " + e.toString()); if (LOG.isDebugEnabled()) { - LOG.debug("Failure detail", e); + LOG.debug("Exception detail:", e); } throw e; } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java index b98b89f445..4af6211baf 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java @@ -206,7 +206,11 @@ public class ProtocolConverter { } protected void handleException(Throwable exception, StompFrame command) throws IOException { - LOG.warn("Exception occured processing: \n" + command, exception); + LOG.warn("Exception occurred processing: \n" + command + ": " + exception.toString()); + if (LOG.isDebugEnabled()) { + LOG.debug("Exception detail", exception); + } + // Let the stomp client know about any protocol errors. ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter stream = new PrintWriter(new OutputStreamWriter(baos, "UTF-8"));