Silwing created CXF-8925: ---------------------------- Summary: Logging twice in case of faults happening after pre-stream phase in out-chain Key: CXF-8925 URL: https://issues.apache.org/jira/browse/CXF-8925 Project: CXF Issue Type: Bug Components: logging Affects Versions: 4.0.2, 3.6.1, 3.5.6 Environment: CXF server implementation using LoggingOutInterceptor on both out chain and out fault chain (e.g. through LoggingFeature). Reporter: Silwing
When using the LoggingOutInterceptor in a server context with the interceptor added to the Out Chain and the Out Fault Chain events will be created and sent twice if faults occur after the phase the LoggingOutIntercept is bound to. The cause of the issue is that handleMessage is called twice; once during the out chain and once during the out fault chain. This wraps the message content OutputStream twice in LoggingOutputStreams and adds two callbacks both creating logging events and sending them to the LogEventSender. When combined with the StaxOutInterceptor it furthermore causes one of the events to have an empty payload. This is due to the StaxOutInterceptor wrapping the LoggingOutputStream created during the out chain, and *not* the LoggingOutputStream created during the out fault chain. Meaning content is only written to the inner LoggingOutputStream and not to the outer one. -- This message was sent by Atlassian Jira (v8.20.10#820010)