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 MDCAdapter
public String get(String key)
get
in interface MDCAdapter
public 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 MDCAdapter
IllegalArgumentException
- in case the "key" or "val" parameter is nullpublic void remove(String key)
remove
in interface MDCAdapter
public Map getCopyOfContextMap()
getCopyOfContextMap
in interface MDCAdapter
public void setContextMap(Map contextMap)
setContextMap
in interface MDCAdapter
Copyright © 2005–2017 QOS.ch. All rights reserved.