You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2016/09/06 00:37:18 UTC
logging-log4j2 git commit: AsyncLoggerConfigDisruptor now extends
AbstractLifeCycle so we can call stop(long, TimeUnit) soon.
Repository: logging-log4j2
Updated Branches:
refs/heads/master ef775677c -> ca5b53680
AsyncLoggerConfigDisruptor now extends AbstractLifeCycle so we can call
stop(long, TimeUnit) soon.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ca5b5368
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ca5b5368
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ca5b5368
Branch: refs/heads/master
Commit: ca5b53680bcae07d69ab537823ef128dbf036d2c
Parents: ef77567
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Sep 5 20:37:15 2016 -0400
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Sep 5 20:37:15 2016 -0400
----------------------------------------------------------------------
.../logging/log4j/core/async/AsyncLoggerConfigDisruptor.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ca5b5368/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java
index 1b3beb5..e864ce8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java
@@ -22,7 +22,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.AbstractLifeCycle;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.impl.LogEventFactory;
@@ -32,7 +32,6 @@ import org.apache.logging.log4j.core.jmx.RingBufferAdmin;
import org.apache.logging.log4j.core.util.ExecutorServices;
import org.apache.logging.log4j.core.util.Log4jThreadFactory;
import org.apache.logging.log4j.message.ReusableMessage;
-import org.apache.logging.log4j.status.StatusLogger;
import com.lmax.disruptor.EventFactory;
import com.lmax.disruptor.EventTranslatorTwoArg;
@@ -56,11 +55,10 @@ import com.lmax.disruptor.dsl.ProducerType;
* This class serves to make the dependency on the Disruptor optional, so that these classes are only loaded when the
* {@code AsyncLoggerConfig} is actually used.
*/
-public class AsyncLoggerConfigDisruptor implements AsyncLoggerConfigDelegate {
+public class AsyncLoggerConfigDisruptor extends AbstractLifeCycle implements AsyncLoggerConfigDelegate {
private static final int MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN = 200;
private static final int SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS = 50;
- private static final Logger LOGGER = StatusLogger.getLogger();
/**
* RingBuffer events contain all information necessary to perform the work in a separate thread.
@@ -235,6 +233,7 @@ public class AsyncLoggerConfigDisruptor implements AsyncLoggerConfigDelegate {
+ "waitStrategy={}, exceptionHandler={}...", disruptor.getRingBuffer().getBufferSize(), waitStrategy
.getClass().getSimpleName(), errorHandler);
disruptor.start();
+ super.start();
}
/**
@@ -272,6 +271,7 @@ public class AsyncLoggerConfigDisruptor implements AsyncLoggerConfigDelegate {
LOGGER.trace("AsyncLoggerConfigDisruptor: {} discarded {} events.", asyncQueueFullPolicy,
DiscardingAsyncQueueFullPolicy.getDiscardCount(asyncQueueFullPolicy));
}
+ super.stop();
}
/**