Package org.jboss.logmanager
Class MDC
java.lang.Object
org.jboss.logmanager.MDC
Mapped diagnostic context. This is a thread-local map used to hold loggable information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clear the current MDC map.copy()
Get a copy of the MDC map.Get a copy of the MDC map.static String
Get the value for a key, ornull
if there is no mapping.static Object
Get the value for a key, ornull
if there is no mapping.static String
Set the value of a key, returning the old value (if any) ornull
if there was none.static Object
Set the value of a key, returning the old value (if any) ornull
if there was none.static String
Remove a key.static Object
removeObject
(String key) Remove a key.
-
Method Details
-
get
Get the value for a key, ornull
if there is no mapping.- Parameters:
key
- the key- Returns:
- the value
-
getObject
Get the value for a key, ornull
if there is no mapping.- Parameters:
key
- the key- Returns:
- the value
-
put
Set the value of a key, returning the old value (if any) ornull
if there was none.- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
putObject
Set the value of a key, returning the old value (if any) ornull
if there was none.- Parameters:
key
- the keyvalue
- the new value- Returns:
- the old value or
null
if there was none
-
remove
Remove a key.- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
removeObject
Remove a key.- Parameters:
key
- the key- Returns:
- the old value or
null
if there was none
-
copy
Get a copy of the MDC map. This is a relatively expensive operation.- Returns:
- a copy of the map
-
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.
-