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

This commit is contained in:
Claus Ibsen 2014-08-07 14:38:58 +02:00
parent ab1e9c78ef
commit 960186af89
3 changed files with 18 additions and 6 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}