logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1506290 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java src/changes/changes.xml
Date Tue, 23 Jul 2013 21:26:19 GMT
Author: rpopma
Date: Tue Jul 23 21:26:19 2013
New Revision: 1506290

URL: http://svn.apache.org/r1506290
Log:
LOG4J2-280: Additional fix to make AsyncAppender threads daemon threads and improve their
thread name.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java?rev=1506290&r1=1506289&r2=1506290&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
Tue Jul 23 21:26:19 2013
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
@@ -60,6 +61,8 @@ public final class AsyncAppender<T exten
     private final boolean includeLocation;
     private AppenderControl<?> errorAppender;
     private AsyncThread thread;
+    private static final AtomicLong threadSequence = new AtomicLong(1);
+
 
     private AsyncAppender(final String name, final Filter filter, final AppenderRef[] appenderRefs,
                            final String errorRef, final int queueSize, final boolean blocking,
@@ -203,6 +206,8 @@ public final class AsyncAppender<T exten
         public AsyncThread(final List<AppenderControl<?>> appenders, final BlockingQueue<Serializable>
queue) {
             this.appenders = appenders;
             this.queue = queue;
+            setDaemon(true);
+            setName("AsyncAppenderThread" + threadSequence.getAndIncrement());
         }
 
         @Override

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1506290&r1=1506289&r2=1506290&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Tue Jul 23 21:26:19 2013
@@ -21,6 +21,9 @@
   </properties>
   <body>
     <release version="2.0-beta9" date="soon, very soon" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-280" dev="rpopma" type="fix">
+        Additional fix to make AsyncAppender threads daemon threads and improve their thread
name.
+      </action>
       <action issue="LOG4J2-165" dev="rgoers" type="fix">
         The slf4j-ext jar is now an optional dependency of the SLF4J bridge.
       </action>



Mime
View raw message