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

noreply.seb at qos.ch noreply.seb at qos.ch
Fri Sep 8 16:41:01 CEST 2006


Author: seb
Date: Fri Sep  8 16:41:01 2006
New Revision: 545

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

Log:
better mdcPropertyMap initialisation

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/spi/LoggingEvent.java	Fri Sep  8 16:41:01 2006
@@ -88,7 +88,7 @@
 
 	private Marker marker;
 	
-	private Map<String, String> MDCPropertyMap;
+	private Map<String, String> mdcPropertyMap;
 
 	/**
 	 * The number of milliseconds elapsed from 1/1/1970 until logging event was
@@ -116,6 +116,8 @@
 			formattedMessage = message;
 		}
 		timeStamp = System.currentTimeMillis();
+
+		mdcPropertyMap = MDC.getPropertyMap();
 	}
 
 	public void setArgumentArray(Object[] argArray) {
@@ -267,10 +269,7 @@
 	}
 	
 	public Map<String, String> getMDCPropertyMap() {
-		//no lazy init since the MDC might
-		//change its map instance.
-		this.MDCPropertyMap = MDC.getPropertyMap();
-		return MDCPropertyMap;
+		return mdcPropertyMap;
 	}
 
 	private void writeObject(ObjectOutputStream out) throws IOException {



More information about the logback-dev mailing list