本文整理汇总了Java中org.slf4j.spi.MDCAdapter.getCopyOfContextMap方法的典型用法代码示例。如果您正苦于以下问题:Java MDCAdapter.getCopyOfContextMap方法的具体用法?Java MDCAdapter.getCopyOfContextMap怎么用?Java MDCAdapter.getCopyOfContextMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.slf4j.spi.MDCAdapter
的用法示例。
在下文中一共展示了MDCAdapter.getCopyOfContextMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMDCPropertyMap
import org.slf4j.spi.MDCAdapter; //导入方法依赖的package包/类
public Map<String, String> getMDCPropertyMap() {
if(this.mdcPropertyMap == null) {
MDCAdapter mdc = MDC.getMDCAdapter();
if(mdc instanceof LogbackMDCAdapter) {
this.mdcPropertyMap = ((LogbackMDCAdapter)mdc).getPropertyMap();
} else {
this.mdcPropertyMap = mdc.getCopyOfContextMap();
}
}
if(this.mdcPropertyMap == null) {
this.mdcPropertyMap = CACHED_NULL_MAP;
}
return this.mdcPropertyMap;
}
示例2: getMDCPropertyMap
import org.slf4j.spi.MDCAdapter; //导入方法依赖的package包/类
public Map<String, String> getMDCPropertyMap() {
// populate mdcPropertyMap if null
if (mdcPropertyMap == null) {
MDCAdapter mdc = MDC.getMDCAdapter();
if (mdc instanceof LogbackMDCAdapter)
mdcPropertyMap = ((LogbackMDCAdapter) mdc).getPropertyMap();
else
mdcPropertyMap = mdc.getCopyOfContextMap();
}
// mdcPropertyMap still null, use CACHED_NULL_MAP
if (mdcPropertyMap == null)
mdcPropertyMap = CACHED_NULL_MAP;
return mdcPropertyMap;
}