程序包 org.slf4j
类 LampMdcAdapter
java.lang.Object
org.slf4j.LampMdcAdapter
- 所有已实现的接口:
org.slf4j.spi.MDCAdapter
重构
LogbackMDCAdapter类,搭配TransmittableThreadLocal实现父子线程之间的数据传递- 作者:
- Ceki Gülcü, zuihou
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()Clear all entries in the MDC.voidclearDequeByKey(String key) Get the context identified by thekeyparameter.Return a copy of the current thread's context map.static org.slf4j.spi.MDCAdaptergetKeys()Returns the keys in the MDC as aSet.Get the current thread's MDC as a map.voidvoidPut a context value (thevalparameter) as identified with thekeyparameter into the current thread's context map.voidRemove the the context identified by thekeyparameter.voidsetContextMap(Map<String, String> contextMap)
-
构造器详细资料
-
LampMdcAdapter
public LampMdcAdapter()
-
-
方法详细资料
-
getInstance
public static org.slf4j.spi.MDCAdapter getInstance() -
put
Put a context value (thevalparameter) as identified with thekeyparameter into the current thread's context map. Note that contrary to log4j, thevalparameter can be null. If the current thread does not have a context map it is created as a side effect of this call.- 指定者:
put在接口中org.slf4j.spi.MDCAdapter- 抛出:
IllegalArgumentException- in case the "key" parameter is null
-
remove
Remove the the context identified by thekeyparameter.- 指定者:
remove在接口中org.slf4j.spi.MDCAdapter
-
clear
public void clear()Clear all entries in the MDC.- 指定者:
clear在接口中org.slf4j.spi.MDCAdapter
-
get
Get the context identified by thekeyparameter.- 指定者:
get在接口中org.slf4j.spi.MDCAdapter
-
getPropertyMap
Get the current thread's MDC as a map. This method is intended to be used internally. -
getKeys
Returns the keys in the MDC as aSet. The returned value can be null. -
getCopyOfContextMap
Return a copy of the current thread's context map. Returned value may be null.- 指定者:
getCopyOfContextMap在接口中org.slf4j.spi.MDCAdapter
-
setContextMap
- 指定者:
setContextMap在接口中org.slf4j.spi.MDCAdapter
-
pushByKey
- 指定者:
pushByKey在接口中org.slf4j.spi.MDCAdapter
-
popByKey
- 指定者:
popByKey在接口中org.slf4j.spi.MDCAdapter
-
getCopyOfDequeByKey
- 指定者:
getCopyOfDequeByKey在接口中org.slf4j.spi.MDCAdapter
-
clearDequeByKey
- 指定者:
clearDequeByKey在接口中org.slf4j.spi.MDCAdapter
-