From 4535e8f097c993364026c00ed40777c71a36a6ea Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Thu, 11 Jan 2018 07:27:03 -0500 Subject: [PATCH] AMQ-6884 - Replacing printStackTrace() with logging statement --- .../apache/activemq/transport/nio/SelectorWorker.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java index 1a32346376..781ca67710 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java @@ -24,8 +24,13 @@ import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class SelectorWorker implements Runnable { + private static final Logger LOG = LoggerFactory.getLogger(SelectorWorker.class); + private static final AtomicInteger NEXT_ID = new AtomicInteger(); final SelectorManager manager; @@ -73,7 +78,7 @@ public class SelectorWorker implements Runnable { try { task.run(); } catch (Throwable e) { - e.printStackTrace(); + LOG.debug(e.getMessage(), e); } } } @@ -142,7 +147,7 @@ public class SelectorWorker implements Runnable { manager.onWorkerEmptyEvent(this); selector.close(); } catch (IOException ignore) { - ignore.printStackTrace(); + LOG.debug(ignore.getMessage(), ignore); } Thread.currentThread().setName(origName); }