activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1088631 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
Date Mon, 04 Apr 2011 14:09:30 GMT
Author: gtully
Date: Mon Apr  4 14:09:30 2011
New Revision: 1088631

URL: http://svn.apache.org/viewvc?rev=1088631&view=rev
Log:
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

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java?rev=1088631&r1=1088630&r2=1088631&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/LoggingBrokerPlugin.java
Mon Apr  4 14:09:30 2011
@@ -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
     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
     }
 
     /**
-     * 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
 
     @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
 
     @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
         buf.append(isLogAll());
         buf.append(", logConnectionEvents=");
         buf.append(isLogConnectionEvents());
+        buf.append(", logSessionEvents=");
+        buf.append(isLogSessionEvents());
         buf.append(", logConsumerEvents=");
         buf.append(isLogConsumerEvents());
         buf.append(", logProducerEvents=");



Mime
View raw message