Package org.jboss.logmanager
Class MDC
- java.lang.Object
-
- org.jboss.logmanager.MDC
-
public final class MDC extends java.lang.ObjectMapped diagnostic context. This is a thread-local map used to hold loggable information.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()Clear the current MDC map.static java.util.Map<java.lang.String,java.lang.String>copy()Get a copy of the MDC map.static java.util.Map<java.lang.String,java.lang.Object>copyObject()Get a copy of the MDC map.static java.lang.Stringget(java.lang.String key)Get the value for a key, ornullif there is no mapping.static java.lang.ObjectgetObject(java.lang.String key)Get the value for a key, ornullif there is no mapping.static java.lang.Stringput(java.lang.String key, java.lang.String value)Set the value of a key, returning the old value (if any) ornullif there was none.static java.lang.ObjectputObject(java.lang.String key, java.lang.Object value)Set the value of a key, returning the old value (if any) ornullif there was none.static java.lang.Stringremove(java.lang.String key)Remove a key.static java.lang.ObjectremoveObject(java.lang.String key)Remove a key.
-
-
-
Method Detail
-
get
public static java.lang.String get(java.lang.String key)
Get the value for a key, ornullif there is no mapping.- Parameters:
key- the key- Returns:
- the value
-
getObject
public static java.lang.Object getObject(java.lang.String key)
Get the value for a key, ornullif there is no mapping.- Parameters:
key- the key- Returns:
- the value
-
put
public static java.lang.String put(java.lang.String key, java.lang.String value)Set the value of a key, returning the old value (if any) ornullif there was none.- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
putObject
public static java.lang.Object putObject(java.lang.String key, java.lang.Object value)Set the value of a key, returning the old value (if any) ornullif there was none.- Parameters:
key- the keyvalue- the new value- Returns:
- the old value or
nullif there was none
-
remove
public static java.lang.String remove(java.lang.String key)
Remove a key.- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
removeObject
public static java.lang.Object removeObject(java.lang.String key)
Remove a key.- Parameters:
key- the key- Returns:
- the old value or
nullif there was none
-
copy
public static java.util.Map<java.lang.String,java.lang.String> copy()
Get a copy of the MDC map. This is a relatively expensive operation.- Returns:
- a copy of the map
-
copyObject
public static java.util.Map<java.lang.String,java.lang.Object> copyObject()
Get a copy of the MDC map. This is a relatively expensive operation.- Returns:
- a copy of the map
-
clear
public static void clear()
Clear the current MDC map.
-
-