Repository: logging-log4j2 Updated Branches: refs/heads/master c705ffdc1 -> d8ede120f
LOG4J2-493 better status debug logging during disruptor start/stop Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d8ede120 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d8ede120 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d8ede120 Branch: refs/heads/master Commit: d8ede120f066f1112467717d724e9d9627dde675 Parents: c705ffd Author: rpopma <rpo...@apache.org> Authored: Sat Oct 24 01:10:18 2015 +0900 Committer: rpopma <rpo...@apache.org> Committed: Sat Oct 24 01:10:18 2015 +0900 ---------------------------------------------------------------------- .../logging/log4j/core/async/AsyncLoggerHelper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d8ede120/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerHelper.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerHelper.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerHelper.java index 5c90eae..bd8508a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerHelper.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerHelper.java @@ -75,10 +75,11 @@ class AsyncLoggerHelper { */ synchronized void start() { if (disruptor != null) { - LOGGER.trace("[{}] AsyncLoggerHelper not starting new disruptor, using existing object.", contextName); + LOGGER.trace("[{}] AsyncLoggerHelper not starting new disruptor for this context, using existing object.", + contextName); return; } - LOGGER.trace("[{}] AsyncLoggerHelper creating new disruptor.", contextName); + LOGGER.trace("[{}] AsyncLoggerHelper creating new disruptor for this context.", contextName); final int ringBufferSize = calculateRingBufferSize(); final WaitStrategy waitStrategy = createWaitStrategy(); executor = Executors.newSingleThreadExecutor(new DaemonThreadFactory("AsyncLogger[" + contextName + "]")); @@ -94,7 +95,7 @@ class AsyncLoggerHelper { disruptor.handleEventsWith(handlers); LOGGER.debug( - "[{}] Starting AsyncLogger disruptor with ringbufferSize={}, waitStrategy={}, exceptionHandler={}...", + "[{}] Starting AsyncLogger disruptor for this context with ringbufferSize={}, waitStrategy={}, exceptionHandler={}...", contextName, disruptor.getRingBuffer().getBufferSize(), waitStrategy.getClass().getSimpleName(), errorHandler); disruptor.start(); @@ -182,13 +183,12 @@ class AsyncLoggerHelper { synchronized void stop() { final Disruptor<RingBufferLogEvent> temp = getDisruptor(); if (temp == null) { - LOGGER.trace("[{}] AsyncLoggerHelper: disruptor already shut down.", contextName); + LOGGER.trace("[{}] AsyncLoggerHelper: disruptor for this context already shut down.", contextName); return; // disruptor was already shut down by another thread } - LOGGER.debug("[{}] AsyncLoggerHelper: shutting down disruptor.", contextName); + LOGGER.debug("[{}] AsyncLoggerHelper: shutting down disruptor for this context.", contextName); - // Must guarantee that publishing to the RingBuffer has stopped - // before we call disruptor.shutdown() + // We must guarantee that publishing to the RingBuffer has stopped before we call disruptor.shutdown(). disruptor = null; // client code fails with NPE if log after stop. This is by design. // Calling Disruptor.shutdown() will wait until all enqueued events are fully processed,