不推荐使用Apache CXF LoggingInInterceptor-改用什么? [英] Apache CXF LoggingInInterceptor is deprecated - what to use instead?
问题描述
我正在通过版本3.2.7的cxf-spring-boot-starter-jaxws
插件将Apache CXF与Spring Boot结合使用.
I am using Apache CXF with Spring Boot with the help of cxf-spring-boot-starter-jaxws
plugin of version 3.2.7.
我的意图是自定义LoggingInterceptor,但是当我创建以下类时:
My intention is to customize the LoggingInterceptors but when I created the below class:
public class CustomLoggingInInterceptor extends org.apache.cxf.interceptor.LoggingInInterceptor {}
但是我的IDE删除了LoggingInInterceptor并抱怨说它已被解释弃用
but my IDE strikes out the LoggingInInterceptor complaining it's deprecated with the explanation
改为使用日志记录模块rt/features/logging
use logging module rt/features/logging instead
那么该如何使用该模块自定义日志记录拦截器呢?
So how should one go about customizing the logging interceptor using this module ?
推荐答案
此消息告诉您的是使用Apache CXF Advanced logging feature
模块.
What this message is telling you, is to use the Apache CXF Advanced logging feature
module.
其依赖项为(最新版本)
Its dependency is (latest version)
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-features-logging</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
在内部,您可以找到类似的org.apache.cxf.ext.logging.LoggingInInterceptor
(
Inside you'll find a comparable org.apache.cxf.ext.logging.LoggingInInterceptor
(link)
我不是CXF用户,但是我想您必须与JaxWsProxyFactoryBean
进行交互.
请记住,所有CXF模块都需要使用相同的版本.
I'm not a CXF user, however I suppose you'll have to interact with a JaxWsProxyFactoryBean
.
Remember you need to use the same version for all the CXF modules.
抓住它之后,就可以
factory.getInInterceptors().add(new MyCustomInterceptor());
这篇关于不推荐使用Apache CXF LoggingInInterceptor-改用什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!