[logback-dev] svn commit: r994 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic

noreply.ceki at qos.ch noreply.ceki at qos.ch
Thu Nov 23 13:23:00 CET 2006


Author: ceki
Date: Thu Nov 23 13:23:00 2006
New Revision: 994

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java

Log:
When removing keys from the MDC, the new value should be stored as a Threadlocal.

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/MDC.java	Thu Nov 23 13:23:00 2006
@@ -44,8 +44,8 @@
     if (oldMap != null) {
     	newMap.putAll(oldMap);
     }
+    // the newMap replaces the old one for serialisation's sake
     threadLocal.set(newMap);
-    
     newMap.put(key, val);
   }
 
@@ -81,7 +81,8 @@
     if (oldMap != null) {
     	newMap.putAll(oldMap);
     }
-    
+    // the newMap replaces the old one for serialisation's sake
+    threadLocal.set(newMap);
     newMap.remove(key);
   }
 



More information about the logback-dev mailing list