Skip to content

CAMEL-23662: camel-log - Route logMask setting not overriding context logMask#23715

Merged
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-23662
Jun 2, 2026
Merged

CAMEL-23662: camel-log - Route logMask setting not overriding context logMask#23715
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-23662

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

Fixes CAMEL-23662: Setting logMask="false" on a route did not override logMask="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 and CamelContext.isLogMask(). It never checked the route's logMask setting. The Log EIP (LogReifier) correctly consulted route.isLogMask() at reification time, but the Log component endpoint did not.

Fix

  • CamelLogProcessor now supports checking the route's logMask at process time via exchange.getUnitOfWork().getRoute(), respecting the precedence: endpoint parameter > route > context
  • LogEndpoint enables this route-aware behavior when creating the CamelLogProcessor
  • This also fixes the inverse case (route enables masking while context has it disabled)

Test Plan

  • New test LogMaskRouteOverrideTest verifying:
    • Route logMask=false overrides context logMask=true for the log component
    • Route logMask=true overrides context logMask=false for the log component
  • Existing LogMaskTest and LogEipMaskTest still pass (no regressions)
  • Full reactor build passes

Claude Code on behalf of Claus Ibsen

… 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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🧪 CI tested the following changed modules:

  • components/camel-log
  • core/camel-core
  • core/camel-support

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 2 test(s) disabled on GitHub Actions
Build reactor — dependencies compiled but only changed modules were tested (3 modules)
  • Camel :: Core
  • Camel :: Log
  • Camel :: Support

⚙️ View full build and test results

@davsclaus davsclaus merged commit 04a322a into main Jun 2, 2026
6 checks passed
@davsclaus davsclaus deleted the fix/CAMEL-23662 branch June 2, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant