Repository: activemq Updated Branches: refs/heads/activemq-5.10.x b41f92127 -> 22f2f3dde
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/fb3e96a7 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/fb3e96a7 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/fb3e96a7 Branch: refs/heads/activemq-5.10.x Commit: fb3e96a7d6bc8d0505afeee892e4781ef317306c Parents: b41f921 Author: Claus Ibsen <[email protected]> Authored: Thu Aug 7 14:38:58 2014 +0200 Committer: Hadrian Zbarcea <[email protected]> Committed: Wed Dec 17 19:22:23 2014 -0500 ---------------------------------------------------------------------- .../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/fb3e96a7/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/fb3e96a7/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/fb3e96a7/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); + } } }
