You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/02/16 00:28:12 UTC

[logging-log4j2] branch release-2.x updated: LOG4J2-2782 - Use LinkedBlockingQueue instead of synchronous collection

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new d53e13c  LOG4J2-2782 - Use LinkedBlockingQueue instead of synchronous collection
d53e13c is described below

commit d53e13c909c36de59e969ba59c35ac8b413ef6e4
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sat Feb 15 17:07:07 2020 -0700

    LOG4J2-2782 - Use LinkedBlockingQueue instead of synchronous collection
---
 .../apache/logging/log4j/core/config/status/StatusConfiguration.java | 5 ++---
 src/changes/changes.xml                                              | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/status/StatusConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/status/StatusConfiguration.java
index a6f4d1f..413c186 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/status/StatusConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/status/StatusConfiguration.java
@@ -24,8 +24,7 @@ import java.io.PrintStream;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
+import java.util.concurrent.LinkedBlockingQueue;
 
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.util.FileUtils;
@@ -44,7 +43,7 @@ public class StatusConfiguration {
     private static final Level DEFAULT_STATUS = Level.ERROR;
     private static final Verbosity DEFAULT_VERBOSITY = Verbosity.QUIET;
 
-    private final Collection<String> errorMessages = Collections.synchronizedCollection(new LinkedList<String>());
+    private final Collection<String> errorMessages = new LinkedBlockingQueue<String>();
     private final StatusLogger logger = StatusLogger.getLogger();
 
     private volatile boolean initialized = false;
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1598a03..72adc8e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,7 +30,10 @@
          - "remove" - Removed
     -->
     <release version="2.13.1" date="2019-MM-DD" description="GA Release 2.13.1">
-      <action issue="LOG4J@-2781" dev="rgiers" type="fix" due-to="qxo">
+      <action issue="LOG4J2-2782" dev="rgoers" type="update">
+        Use LinkedBlockingQueue instead of synchronized collction in StatusConfiguration.
+      </action>
+      <action issue="LOG4J2-2781" dev="rgoers" type="fix" due-to="qxo">
         ServletContainerInitializer was obtaining the StatusLogger too soon.
       </action>
       <action issue="LOG4J2-2676" dev="rgoers" type="fix" due-to="Gregg Donovan">