From 951d87066cb2a2d4184042d02be5337b9091b6cc Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Mon, 4 Apr 2011 14:09:30 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3263 - ActiveMQ LoggingBrokerPlugin too verbose. add logSessionEvents attribute to split connection and session info. Patch applied with thanks git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1088631 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/util/LoggingBrokerPlugin.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java b/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java index 1291e9e6e3..b97b24ee48 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java @@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory; /** * A simple Broker intercepter which allows you to enable/disable logging. - * + * * @org.apache.xbean.XBean */ @@ -58,13 +58,13 @@ public class LoggingBrokerPlugin extends BrokerPluginSupport { private boolean logAll = false; private boolean logMessageEvents = false; private boolean logConnectionEvents = true; + private boolean logSessionEvents = true; private boolean logTransactionEvents = false; private boolean logConsumerEvents = false; private boolean logProducerEvents = false; private boolean logInternalEvents = false; /** - * * @throws Exception * @org.apache.xbean.InitMethod */ @@ -100,12 +100,23 @@ public class LoggingBrokerPlugin extends BrokerPluginSupport { } /** - * Logger Events that are related to connections and sessions + * Logger Events that are related to connections */ public void setLogConnectionEvents(boolean logConnectionEvents) { this.logConnectionEvents = logConnectionEvents; } + public boolean isLogSessionEvents() { + return logSessionEvents; + } + + /** + * Logger Events that are related to sessions + */ + public void setLogSessionEvents(boolean logSessionEvents) { + this.logSessionEvents = logSessionEvents; + } + public boolean isLogTransactionEvents() { return logTransactionEvents; } @@ -367,7 +378,7 @@ public class LoggingBrokerPlugin extends BrokerPluginSupport { @Override public void addSession(ConnectionContext context, SessionInfo info) throws Exception { - if (isLogAll() || isLogConnectionEvents()) { + if (isLogAll() || isLogSessionEvents()) { LOG.info("Adding Session : " + info); } super.addSession(context, info); @@ -375,7 +386,7 @@ public class LoggingBrokerPlugin extends BrokerPluginSupport { @Override public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { - if (isLogAll() || isLogConnectionEvents()) { + if (isLogAll() || isLogSessionEvents()) { LOG.info("Removing Session : " + info); } super.removeSession(context, info); @@ -580,6 +591,8 @@ public class LoggingBrokerPlugin extends BrokerPluginSupport { buf.append(isLogAll()); buf.append(", logConnectionEvents="); buf.append(isLogConnectionEvents()); + buf.append(", logSessionEvents="); + buf.append(isLogSessionEvents()); buf.append(", logConsumerEvents="); buf.append(isLogConsumerEvents()); buf.append(", logProducerEvents=");