【发布时间】:2020-03-18 10:53:58
【问题描述】:
我正在使用 Wildfly 15,我想禁用到 server.log 和 stderr 的堆栈跟踪日志。
我添加了文件./src/main/webapp/WEB-INF/jboss-deployment-structure.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclude-subsystems>
<subsystem name="logging" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
我配置了 logback.xml 文件。
不幸的是,堆栈跟踪没有记录在 logback.xml 配置中定义的应用程序日志文件中,但它记录在 server.log 文件和 stderr 中:
2020-03-18 11:32:33,768 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /app/sample/: java.lang.RuntimeException: java.lang.IllegalArgumentException: Sample error !!!
at io.undertow.servlet@2.0.15.Final//io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:247)
at io.undertow.servlet@2.0.15.Final//io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:149)
at io.undertow.servlet@2.0.15.Final//io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:111)
我的应用程序日志文件包含所有日志和上述异常的错误消息。
如何避免这种行为并在应用程序日志文件中获得完整的堆栈跟踪?
【问题讨论】: