gnodet-bot commented on code in PR #29884:
URL: https://github.com/apache/camel/pull/29884#discussion_r4568477832
##########
components/camel-mdc/src/main/docs/mdc.adoc:
##########
@@ -35,15 +35,15 @@ And later you had to make sure to provide MDC context
propagation in async compo
.setHeader("myCustomMDCKey", simple("myCustomKeyValue"))
----
-include the MDC service and additionally instruct the Camel application to
treat that header as a MDC trace (via `camel.mdc.customHeaders=myCustomMDCKey`
or `*` to include all headers). You won't need any longer to worry about
context propagation as the propagation will be done via Camel Exchange instead.
+include the MDC service and additionally instruct the Camel application to
treat that header as a MDC trace (via
`camel.mdc.customExchangeHeaders=myCustomMDCKey` or `*` to include all
headers). You won't need any longer to worry about context propagation as the
propagation will be done via Camel Exchange instead.
NOTE: you won't also need any longer to hack the code using Java DSL, as you
can put headers in any Camel DSL.
Depending on the logging technology used, you can now include the MDC
parameters you want to trace in your logging configuration. For example, in
`log4j2` configuration you can include them as shown below:
[source,text]
----
-... [%X{camel.contextId}, %X{camel.routeId}, %X{camel.exchangeId},
%X{camel.messageId}, %X{customHead}, %X{customProp}]
+... [%X{camel.contextId}, %X{camel.routeId}, %X{camel.exchangeId},
%X{camel.messageId}, %X{myCustomMDCKey}, %X{customProp}]
Review Comment:
`%X{customProp}` was not updated consistently with `%X{customHead}`. Both
were example MDC keys: `customHead` was renamed to `myCustomMDCKey` to match
the header set in the Java example above. The property counterpart should
follow the same pattern for consistency.
```suggestion
... [%X{camel.contextId}, %X{camel.routeId}, %X{camel.exchangeId},
%X{camel.messageId}, %X{myCustomMDCKey}, %X{myCustomMDCProp}]
```
--
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]