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 2018/08/06 22:28:20 UTC

logging-log4j2 git commit: Add low-level method org.apache.logging.log4j.core.appender.AsyncAppender.getThreadQueueSize() to help synch tests in applications.

Repository: logging-log4j2
Updated Branches:
  refs/heads/release-2.x 432c4fbc2 -> 26541ffcb


Add low-level method
org.apache.logging.log4j.core.appender.AsyncAppender.getThreadQueueSize()
to help synch tests in applications.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/26541ffc
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/26541ffc
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/26541ffc

Branch: refs/heads/release-2.x
Commit: 26541ffcbb15623d1d358463344a3b0ba41c66dc
Parents: 432c4fb
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Aug 6 16:28:17 2018 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Aug 6 16:28:17 2018 -0600

----------------------------------------------------------------------
 .../apache/logging/log4j/core/appender/AsyncAppender.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/26541ffc/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
index b0ed1d9..717e5fd 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
@@ -534,4 +534,14 @@ public final class AsyncAppender extends AbstractAppender {
     public int getQueueSize() {
         return queue.size();
     }
+
+    /**
+     * Returns the number of elements in the queue from the background thread.
+     * 
+     * @return the number of elements in the queue from the background thread. 
+     * @since 2.11.2
+     */
+	public int getThreadQueueSize() {
+		return thread == null ? 0 : thread.queue == null ? 0 : thread.queue.size();
+	}
 }