Package org.jadice.util.log
Class MDC
- java.lang.Object
-
- org.jadice.util.log.MDC
-
public class MDC extends Object
Contains methods for MDC Logging. Delegates to the matching logging framework viaLoggerFactory
-
-
Constructor Summary
Constructors Constructor Description MDC()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Remove all values from the MDC.static Object
get(String key)
Get the context value identified by key from the map.static Map<String,String>
getCopy()
static void
put(String key, Object o)
Puts the context value o which can be identified with key into the map.static void
remove(String key)
Remove the context value identified by key from the map.static void
setMap(Map<String,String> map)
Set content of parameter map as the new content of the current MDC map.
-
-
-
Method Detail
-
get
public static Object get(String key)
Get the context value identified by key from the map.- Parameters:
key
- identification key- Returns:
- context value
-
put
public static void put(String key, Object o)
Puts the context value o which can be identified with key into the map.- Parameters:
key
- identification keyo
- value to be put
-
remove
public static void remove(String key)
Remove the context value identified by key from the map.- Parameters:
key
- identification key
-
getCopy
public static Map<String,String> getCopy()
- Returns:
- a copy of the current thread's context map. Returned value may be
null
.
-
setMap
public static void setMap(Map<String,String> map)
Set content of parameter map as the new content of the current MDC map. If parameter is null, it will simply clear the map.- Parameters:
map
- the instance to be set, ornull
.
-
clear
public static void clear()
Remove all values from the MDC.
-
-