【问题标题】:CXF LoggingFeature doesn't log inbound requestCXF LoggingFeature 不记录入站请求
【发布时间】:2020-01-10 14:59:22
【问题描述】:

我已将我的应用程序中的 cxf 版本从 2.x 升级到 3.3.2,因此我想用 LoggingFeature 替换我之前使用的现已弃用的 LoggingInInterceptorLoggingOutInterceptor。为此,我从 cxf 总线中删除了拦截器 bean,并添加了 LoggingFeature,如下所示:

<cxf:bus>
    <cxf:features>
        <bean class="org.apache.cxf.ext.logging.LoggingFeature">
             <property name="prettyLogging" value="true"/>
        </bean>
    </cxf:features>
</cxf:bus> 

我已经有其他步骤来使用 cxf LoggingFeature 和我的 slf4j 设置 as described in this SO question 预先添加以与拦截器一起使用:META-INF/cxf/org.apache.cxf.Logger 文件和 org.apache.cxf log4j2 记录器。

现在结果是传入的请求(应该是 cxf 日志记录类型REQ_INimo)没有被记录,但响应(RESP_OUT)被记录。

什么会导致这种行为?

【问题讨论】:

    标签: java logging cxf log4j2 slf4j


    【解决方案1】:

    好吧,如果有人偶然发现这样的错误:拦截器链在到达 LoggingInterceptor 之前在我的应用程序中被中断,因此传入的请求没有被记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-19
      • 2015-12-30
      • 2022-01-08
      相关资源
      最近更新 更多