本文整理了Java中org.apache.logging.log4j.ThreadContext.clear()
方法的一些代码示例,展示了ThreadContext.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ThreadContext.clear()
方法的具体详情如下:
包路径:org.apache.logging.log4j.ThreadContext
类名称:ThreadContext
方法名:clear
[英]Clears the context map and stack.
[中]清除上下文映射和堆栈。
代码示例来源:origin: org.apache.logging.log4j/log4j12-api
public static void clear() {
localMap.get().clear();
ThreadContext.clear();
}
代码示例来源:origin: org.apache.logging.log4j.adapters/log4j-1.2-api
public static void clear() {
localMap.get().clear();
ThreadContext.clear();
}
代码示例来源:origin: org.apache.logging.log4j.samples/flume-common
public static void initialize() {
ThreadContext.clear();
ThreadContext.put(REQUEST_ID, UUIDUtil.getTimeBasedUUID().toString());
}
代码示例来源:origin: org.apache.logging.log4j.samples/flume-common
public LoggingController() {
ThreadContext.clear();
RequestContext.setSessionId("session1234");
RequestContext.setIpAddress("127.0.0.1");
RequestContext.setClientId("02121");
RequestContext.setProductName("IB");
RequestContext.setProductVersion("4.18.1");
RequestContext.setLocale("en_US");
RequestContext.setRegion("prod");
}
代码示例来源:origin: org.apache.logging.log4j.samples/flume-common
public LoggingApp(String member) {
ThreadContext.clear();
RequestContext.setSessionId("session1234");
RequestContext.setIpAddress("127.0.0.1");
RequestContext.setClientId("02121");
RequestContext.setProductName("IB");
RequestContext.setProductVersion("4.18.1");
RequestContext.setLocale("en_US");
RequestContext.setRegion("prod");
if (events == null) {
events = MockEventsSupplier.getAllEvents(member);
}
}
内容来源于网络,如有侵权,请联系作者删除!