logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1380127 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java src/changes/changes.xml
Date Mon, 03 Sep 2012 04:57:47 GMT
Author: rgoers
Date: Mon Sep  3 04:57:47 2012
New Revision: 1380127

URL: http://svn.apache.org/viewvc?rev=1380127&view=rev
Log:
Fix for LOG4J2-77 - RoutingAppender should only call stop method for Appenders it creates

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

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java?rev=1380127&r1=1380126&r2=1380127&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
Mon Sep  3 04:57:47 2012
@@ -86,8 +86,12 @@ public final class RoutingAppender exten
     @Override
     public void stop() {
         super.stop();
-        for (AppenderControl control : appenders.values()) {
-            control.getAppender().stop();
+        Map<String, Appender> map = config.getAppenders();
+        for (Map.Entry<String, AppenderControl> entry : appenders.entrySet()) {
+            String name = entry.getValue().getAppender().getName();
+            if (!DEFAULT_KEY.equals(entry.getKey()) && !map.containsKey(name)) {
+                entry.getValue().getAppender().stop();
+            }
         }
     }
 

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1380127&r1=1380126&r2=1380127&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Mon Sep  3 04:57:47 2012
@@ -23,6 +23,11 @@
 
   <body>
     <release version="2.0-alpha3" date="TBD" description="">
+      <action issue="LOG4J2-77" dev="rgoers" type="fix">
+        RoutingAppender was calling the stop method for each of its referenced Appenders
and was calling
+        the stop method of the default Appender a second time. It will now only call the
stop method of
+        Appenders it creates.
+      </action>
       <action issue="LOG4J2-76" dev="rgoers" type="fix">
         RewriteAppender was calling the stop method of the referenced appender causing the
referenced appender's
         manager to have its use count decremented too many times.



Mime
View raw message