ceki 2003/03/15 11:43:10
Modified: src/java/org/apache/log4j MDC.java
Log:
Added a clear method in order to clear the MDC entries as requested by Fergus
Gallagher.
Revision Changes Path
1.13 +12 -0 jakarta-log4j/src/java/org/apache/log4j/MDC.java
Index: MDC.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/MDC.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- MDC.java 3 Dec 2002 17:41:04 -0000 1.12
+++ MDC.java 15 Mar 2003 19:43:09 -0000 1.13
@@ -82,6 +82,18 @@
}
/**
+ * Clear all entries in the MDC.
+ * @since 1.3
+ */
+ public static void clear() {
+ Hashtable ht = (Hashtable) tlm.get();
+ if(ht != null) {
+ ht.clear();
+ }
+ }
+
+
+ /**
* Get the current thread's MDC as a hashtable. This method is
* intended to be used internally.
* */
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]