java.lang.Object org.apache.log4j.MDCThe MDC class is similar to the NDC class except that it is based on a map instead of a stack. It provides mapped diagnostic contexts. A Mapped Diagnostic Context, or MDC in short, is an instrument for distinguishing interleaved log output from different sources. Log output is typically interleaved when a server handles multiple clients near-simultaneously.
The MDC is managed on a per thread basis. A child thread automatically inherits a copy of the mapped diagnostic context of its parent.
The MDC class requires JDK 1.2 or above. Under JDK 1.1 the MDC will always return empty values but otherwise will not affect or harm your application.
|static final MDC||mdc|
|static final int||HT_SIZE|
|Method from org.apache.log4j.MDC Summary:|
|clear, get, getContext, put, remove|
|Methods from java.lang.Object:|
|clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from org.apache.log4j.MDC Detail:|
public static void clear()
This method has no side effects.
public static Hashtable getContext()
If the current thread does not have a context map it is created as a side effect.