| java.lang.Object org.slf4j.helpers.BasicMDCAdapter
BasicMDCAdapter | public class BasicMDCAdapter implements MDCAdapter(Code) | | Basic MDC implementation, which can be used with logging systems that
lack out-of-the-box MDC support.
This code is largely based on logback's
LogbackMDCAdapter.
author: Ceki Gulcu author: Maarten Bosteels since: 1.5.0 |
Method Summary | |
public void | clear() Clear all entries in the MDC. | public String | get(String key) Get the context identified by the key parameter. | public Set | getKeys() Returns the keys in the MDC as a
Set of
String s
The returned value can be null. | public 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. | public void | remove(String key) Remove the the context identified by the key parameter. |
clear | public void clear()(Code) | | Clear all entries in the MDC.
|
getKeys | public Set getKeys()(Code) | | Returns the keys in the MDC as a
Set of
String s
The returned value can be null.
the keys in the MDC |
put | public void put(String key, String val)(Code) | | Put a context value (the val parameter) as identified with
the key parameter into the current thread's context map.
Note that contrary to log4j, the val parameter can be null.
If the current thread does not have a context map it is created as a side
effect of this call.
throws: IllegalArgumentException - in case the "key" parameter is null |
remove | public void remove(String key)(Code) | | Remove the the context identified by the key parameter.
|
|
|