vp340 commented on code in PR #3343:
URL: https://github.com/apache/cxf/pull/3343#discussion_r3808955049
##########
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java:
##########
@@ -25,20 +25,21 @@
import java.util.regex.Pattern;
import org.apache.cxf.common.util.PropertyUtils;
-import org.apache.cxf.ext.logging.event.DefaultLogEventMapper;
-import org.apache.cxf.ext.logging.event.LogEvent;
-import org.apache.cxf.ext.logging.event.LogEventSender;
-import org.apache.cxf.ext.logging.event.PrettyLoggingFilter;
+import org.apache.cxf.ext.logging.event.*;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import static
org.apache.cxf.ext.logging.event.DefaultLogEventMapper.normalizeFlow;
+
public abstract class AbstractLoggingInterceptor extends
AbstractPhaseInterceptor<Message> {
public static final int DEFAULT_LIMIT = 48 * 1024;
public static final int DEFAULT_THRESHOLD = -1;
public static final String CONTENT_SUPPRESSED = "--- Content suppressed
---";
protected static final String LIVE_LOGGING_PROP =
"org.apache.cxf.logging.enable";
+ protected static final String IDEMPOTENT_LOGGING_PROP =
"org.apache.cxf.idempotent.logging."; // the EventType (flow) and ExchangeId
will be concatenated
Review Comment:
Hi @reta , I'm back .
I tested the case with more cxf clients in a row (here the example
https://github.com/vp340/cxf-log-example/tree/test_more_cxf_client ) . The
properties from ResponseContext set in RESP_IN are propagated only in RESP_OUT
and not to other REQ_OUT/RESP_IN (As expected, but I wanted to be sure) .
So your solution to add MessageUtils.isRequestor(message) to the
LIVE_LOGGING_PROP should do the job! :)
The only inaccuracy remains that the properties is still propagated across
the RESP_IN / RESP_OUT Messages (even if it's ignored).
If U are interested I also tried to fix my solution decoupling the core
module from the logging module.
Now I used in the core module a Set of property field to remove from the
ResponseContext Map when the ClientImpl populate the map from the InMessage.
Then I exposed a method to add to that set other properties to exclude.
So now the logging module can say to the core module: "I put the
LIVE_LOGGING_PROP into the Message... but be careful not to propagate it into
the ResponseContext". (this could be apply also for other modules in the future
if someone call Message.put(...) but doesn't want to propagate the property
into the ResponseContext).
As from the previous analisys it's only an IN problem... I set the adding of
LIVE_LOGGING_PROP only in the LoggingInInterceptor constructor.
I would appreciate if U could take a look and maybe give me your opinion (If
U see other problem or suggestion about the stile of the code).
(https://github.com/apache/cxf/pull/3373/ )
Thanks in advance.
Have a great day!
Valentino Porta
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]