Package org.jboss.logging
Class MDC
java.lang.Object
org.jboss.logging.MDC
Mapped diagnostic context. Each log provider implementation may behave different.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clears the message diagnostics context.static Object
Returns the value for the key ornull
if no value was found.getMap()
Returns the map from the context.static Object
Puts the value onto the context.static void
Removes the value from the context.
-
Constructor Details
-
MDC
private MDC()
-
-
Method Details
-
put
Puts the value onto the context.- Parameters:
key
- the key for the valueval
- the value- Returns:
- the previous value set or
null
if no value was set
-
get
Returns the value for the key ornull
if no value was found.- Parameters:
key
- the key to lookup the value for- Returns:
- the value or
null
if 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.
-