public class Log4jMDCAdapter extends Object implements MDCAdapter
| Constructor and Description |
|---|
Log4jMDCAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
String |
get(String key) |
Map |
getCopyOfContextMap() |
void |
put(String key,
String val)
Put a context value (the
val parameter) as identified with
the key parameter into the current thread's context map. |
void |
remove(String key) |
void |
setContextMap(Map contextMap) |
public void clear()
clear in interface MDCAdapterpublic String get(String key)
get in interface MDCAdapterpublic void put(String key, String val)
val parameter) as identified with
the key parameter into the current thread's context map. The
key parameter cannot be null. Log4j does not
support null for the val parameter.
This method delegates all work to log4j's MDC.
put in interface MDCAdapterIllegalArgumentException - in case the "key" or "val" parameter is nullpublic void remove(String key)
remove in interface MDCAdapterpublic Map getCopyOfContextMap()
getCopyOfContextMap in interface MDCAdapterpublic void setContextMap(Map contextMap)
setContextMap in interface MDCAdapterCopyright © 2005–2017 QOS.ch. All rights reserved.