【问题标题】:Wildfly disable log to server.logWildfly 禁用日志到 server.log
【发布时间】: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)

我的应用程序日志文件包含所有日志和上述异常的错误消息。

如何避免这种行为并在应用程序日志文件中获得完整的堆栈跟踪?

【问题讨论】:

    标签: logging wildfly


    【解决方案1】:

    不幸的是,目前对此无能为力。因为 Undertow 是服务器的一部分,所以堆栈跟踪将被记录到日志子系统中定义的默认日志上下文中。

    【讨论】:

      猜你喜欢
      • 2020-08-30
      • 1970-01-01
      • 2021-10-30
      • 1970-01-01
      • 2015-10-30
      • 2020-09-06
      • 1970-01-01
      • 2020-12-01
      • 2015-05-28
      相关资源
      最近更新 更多