Top Description Constructors Methods
org.jboss.logging

public final Class MDC

extends Object
Class Inheritance
Imports
java.util.Collections, .Map

Mapped diagnostic context. Each log provider implementation may behave different.

Constructor Summary

AccessConstructor and Description
private
MDC()

Method Summary

Modifier and TypeMethod and Description
public static void
clear()

Clears the message diagnostics context.

public static Object

Returns:

the value or null if not found
get
(String
the key to lookup the value for
key
)

Returns the value for the key or null if no value was found.

public static Map<String, Object>

Returns:

the map from the context or an empty map if the context is null
getMap
()

Returns the map from the context.

public static Object

Returns:

the previous value set or null if no value was set
put
(String
the key for the value
key
,
Object
the value
val
)

Puts the value onto the context.

public static void
remove(String
the key of the value to remove
key
)

Removes the value from the context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MDCback to summary
private MDC()

Method Detail

clearback to summary
public static void clear()

Clears the message diagnostics context.

getback to summary
public static Object get(String key)

Returns the value for the key or null if no value was found.

Parameters
key:String

the key to lookup the value for

Returns:Object

the value or null if not found

getMapback to summary
public static Map<String, Object> getMap()

Returns the map from the context.

Note that in most implementations this is an expensive operation and should be used sparingly.

Returns:Map<String, Object>

the map from the context or an empty map if the context is null

putback to summary
public static Object put(String key, Object val)

Puts the value onto the context.

Parameters
key:String

the key for the value

val:Object

the value

Returns:Object

the previous value set or null if no value was set

removeback to summary
public static void remove(String key)

Removes the value from the context.

Parameters
key:String

the key of the value to remove