org.apache.log4j
public class MDC extends Object
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.
Since: 1.2
Method Summary | |
---|---|
static Object | get(String key)
Get the context identified by the key parameter.
|
static Hashtable | getContext()
Get the current thread's MDC as a hashtable. |
static void | put(String key, Object o)
Put a context value (the o parameter) as identified
with the key parameter into the current thread's
context map.
|
static void | remove(String key)
Remove the the context identified by the key
parameter. |
key
parameter.
This method has no side effects.
o
parameter) as identified
with the key
parameter into the current thread's
context map.
If the current thread does not have a context map it is created as a side effect.
key
parameter.