Basically 4 things are needed to update from the old to the new cxf logging (rt/features/logging).
First, Set the logging feature:
final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setFeatures(Collections.singletonList(new CustomLoggingFeature()));
You don't need anymore the interceptors (in case you used them, delete them):
factory.getInInterceptors().add(new CustomMaskedLoggingInInterceptor());
factory.getOutInterceptors().add(new CustomMaskedLoggingOutInterceptor());
Second, create your LoggingFeature:
public class CustomLoggingFeature extends org.apache.cxf.ext.logging.LoggingFeature {
public CustomLoggingFeature() {
super();
this.setSender(new CustomEventLogSender());
}
}
Third, create your EventLogSender:
public class CustomEventLogSender extends Slf4jVerboseEventSender {
@Override
protected String getLogMessage(LogEvent event) {
String logMessage = super.getLogMessage(event);
return CustomMasker.mask(logMessage);
}
}
Fourth, create a CustomMasker class where you have your own string manipulation logic to mask the desired information.
Let me know if it worked!