我正在尝试从log4j-1.x升级到log4j-2.3,并在运行时得到以下错误。我遗漏了什么吗?
public void debug(String msg) {
appendContext();
logger.debug(msg);
ThreadContext.pop();
}5/25/16 20:08:16:748 SGT 0000006a com.ibm.ws.webcontainer.servlet.ServletWrapper服务SRVE0068E:应用程序DBIN中间件中servlet MWServlet的服务方法之一引发异常。创建的异常:[ org.apache.logging.log4j.spi.DefaultThreadContextStack.pop(DefaultThreadContextStack.java:185):org.apache.logging.log4j.ThreadContext.pop(ThreadContext.java:391)的ThreadContext堆栈在ThreadContext上为空
发布于 2017-12-22 11:50:47
ThreadContext对象具有堆栈对象和映射对象。ThreadContext.isEmpty()是对地图的检查,而ThreadContext.pop()是堆栈上的检查。
下面的支票对我有效:
if (!ThreadContext.getImmutableStack().isEmpty()) {
ThreadContext.pop();
}https://stackoverflow.com/questions/37436945
复制相似问题