CAMEL-23662: camel-log - Route logMask setting not overriding context logMask#23715
Merged
Conversation
… logMask for log component The log component endpoint (LogEndpoint) resolved the logMask decision at endpoint creation time, consulting only the endpoint URI parameter and the CamelContext, but never the route's logMask setting. This caused logMask=false on a route to be ignored when using <to uri="log:..."/>. CamelLogProcessor now checks the route's logMask at process time via the exchange's UnitOfWork, respecting the precedence: endpoint > route > context. This also handles the inverse case where a route enables masking while the context has it disabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
Build reactor — dependencies compiled but only changed modules were tested (3 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CAMEL-23662: Setting
logMask="false"on a route did not overridelogMask="true"on the CamelContext when using the log component (<to uri="log:..."/>). The override only worked with the Log EIP (.log("...")) or as a query parameter on the endpoint URI (?logMask=false).Root Cause
LogEndpoint.getMaskingFormatter()resolved the masking decision at endpoint creation time, consulting only the endpoint's URI parameter andCamelContext.isLogMask(). It never checked the route'slogMasksetting. The Log EIP (LogReifier) correctly consultedroute.isLogMask()at reification time, but the Log component endpoint did not.Fix
CamelLogProcessornow supports checking the route'slogMaskat process time viaexchange.getUnitOfWork().getRoute(), respecting the precedence: endpoint parameter > route > contextLogEndpointenables this route-aware behavior when creating theCamelLogProcessorTest Plan
LogMaskRouteOverrideTestverifying:logMask=falseoverrides contextlogMask=truefor the log componentlogMask=trueoverrides contextlogMask=falsefor the log componentLogMaskTestandLogEipMaskTeststill pass (no regressions)Claude Code on behalf of Claus Ibsen