Package org.jboss.logging
Class MDC
java.lang.Object
org.jboss.logging.MDC
Mapped diagnostic context. Each log provider implementation may behave different.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the message diagnostics context.static ObjectReturns the value for the key ornullif no value was found.getMap()Returns the map from the context.static ObjectPuts the value onto the context.static voidRemoves the value from the context.
-
Method Details
-
put
Puts the value onto the context.- Parameters:
key- the key for the valueval- the value- Returns:
- the previous value set or
nullif no value was set
-
get
Returns the value for the key ornullif no value was found.- Parameters:
key- the key to lookup the value for- Returns:
- the value or
nullif not found
-
remove
Removes the value from the context.- Parameters:
key- the key of the value to remove
-
getMap
Returns the map from the context.Note that in most implementations this is an expensive operation and should be used sparingly.
- Returns:
- the map from the context or an empty map if the context is
null
-
clear
public static void clear()Clears the message diagnostics context.
-