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:23 UTC
[logging-log4j2] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new b74f92c LOG4J2-2782 - Use LinkedBlockingQueue instead of synchronous collection
b74f92c is described below
commit b74f92cbf1e7107b0ef637f252d752b1470c7aee
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sat Feb 15 17:06:50 2020 -0700
LOG4J2-2782 - Use LinkedBlockingQueue instead of synchronous collection
---
.../logging/log4j/core/config/status/StatusConfiguration.java | 6 +++---
src/changes/changes.xml | 5 ++++-
2 files changed, 7 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 11461a7..1ad67a3 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,8 @@ 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 +44,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 d9ca34c..2b02b02 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -166,7 +166,10 @@
</action>
</release>
<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-2703" dev="goers" type="fix" due-to="Volkan Yazici">