activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: AMQ-5312: Reduce logging noise for activemq-pool if its stopped.
Date Thu, 07 Aug 2014 13:06:29 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk ab1e9c78e -> 960186af8


AMQ-5312: Reduce logging noise for activemq-pool if its stopped.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/960186af
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/960186af
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/960186af

Branch: refs/heads/trunk
Commit: 960186af89d0fb6601ba147c5aa7216cc769aa7f
Parents: ab1e9c7
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Thu Aug 7 14:38:58 2014 +0200
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Thu Aug 7 14:54:52 2014 +0200

----------------------------------------------------------------------
 .../org/apache/activemq/pool/JcaPooledConnectionFactory.java | 8 ++++++--
 .../org/apache/activemq/pool/PooledConnectionFactory.java    | 8 ++++++--
 .../org/apache/activemq/pool/XaPooledConnectionFactory.java  | 8 ++++++--
 3 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/960186af/activemq-pool/src/main/java/org/apache/activemq/pool/JcaPooledConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-pool/src/main/java/org/apache/activemq/pool/JcaPooledConnectionFactory.java
b/activemq-pool/src/main/java/org/apache/activemq/pool/JcaPooledConnectionFactory.java
index 55c2482..4788c1b 100644
--- a/activemq-pool/src/main/java/org/apache/activemq/pool/JcaPooledConnectionFactory.java
+++ b/activemq-pool/src/main/java/org/apache/activemq/pool/JcaPooledConnectionFactory.java
@@ -53,8 +53,12 @@ public class JcaPooledConnectionFactory extends XaPooledConnectionFactory
{
                     public void onException(IOException error) {
                         synchronized (this) {
                             setHasExpired(true);
-                            LOG.info("Expiring connection " + connection + " on IOException:
" + error);
-                            LOG.debug("Expiring connection on IOException", error);
+                            // only log if not stopped
+                            if (!stopped.get()) {
+                                LOG.info("Expiring connection " + connection + " on IOException:
" + error.getMessage());
+                                // log stacktrace at debug level
+                                LOG.debug("Expiring connection " + connection + " on IOException:
", error);
+                            }
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/960186af/activemq-pool/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-pool/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
b/activemq-pool/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
index 1cd5130..ee38bea 100644
--- a/activemq-pool/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
+++ b/activemq-pool/src/main/java/org/apache/activemq/pool/PooledConnectionFactory.java
@@ -110,8 +110,12 @@ public class PooledConnectionFactory extends org.apache.activemq.jms.pool.Pooled
                     public void onException(IOException error) {
                         synchronized (this) {
                             setHasExpired(true);
-                            LOG.info("Expiring connection {} on IOException: {}" , connection,
error);
-                            LOG.debug("Expiring connection on IOException", error);
+                            // only log if not stopped
+                            if (!stopped.get()) {
+                                LOG.info("Expiring connection " + connection + " on IOException:
" + error.getMessage());
+                                // log stacktrace at debug level
+                                LOG.debug("Expiring connection " + connection + " on IOException:
", error);
+                            }
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/960186af/activemq-pool/src/main/java/org/apache/activemq/pool/XaPooledConnectionFactory.java
----------------------------------------------------------------------
diff --git a/activemq-pool/src/main/java/org/apache/activemq/pool/XaPooledConnectionFactory.java
b/activemq-pool/src/main/java/org/apache/activemq/pool/XaPooledConnectionFactory.java
index 7465253..0c80c77 100644
--- a/activemq-pool/src/main/java/org/apache/activemq/pool/XaPooledConnectionFactory.java
+++ b/activemq-pool/src/main/java/org/apache/activemq/pool/XaPooledConnectionFactory.java
@@ -96,8 +96,12 @@ public class XaPooledConnectionFactory extends org.apache.activemq.jms.pool.XaPo
                     public void onException(IOException error) {
                         synchronized (this) {
                             setHasExpired(true);
-                            LOG.info("Expiring connection " + connection + " on IOException:
" + error);
-                            LOG.debug("Expiring connection on IOException", error);
+                            // only log if not stopped
+                            if (!stopped.get()) {
+                                LOG.info("Expiring connection " + connection + " on IOException:
" + error.getMessage());
+                                // log stacktrace at debug level
+                                LOG.debug("Expiring connection " + connection + " on IOException:
", error);
+                            }
                         }
                     }
 


Mime
View raw message