[ 
https://issues.apache.org/jira/browse/CAMEL-23662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erich Mauerböck updated CAMEL-23662:
------------------------------------
    Description: 
When registering a "CamelCustomLogMask" and using it by setting "logMask" 
property to "true" on a camel context like so, log endpoints are masked as 
expected:
{code:xml}
<bean id="CamelCustomLogMask" 
class="com.company.my.formatter.CustomMaskingFormatter" />
<camelContext xmlns="http://camel.apache.org/schema/spring"; logMask="true">
  ...
</camelContext>{code}
When trying to override that setting on a specific route inside the camel 
context by setting "logMask" to "false" there, there is no effect, logs are 
still masked:
{code:xml}
<route id="my/route" logMask="false">
  ...
  <to uri="log:com.company.my.out" />
</route>
{code}
What actually DOES work is setting it as a query parameter on the endpoint 
inside the route like so:
{code:xml}
<route id="my/route">
  <to uri="log:com.company.my.out?logMask=false" />
</route>{code}
I would expect the setting on the route to override the global one of the camel 
context.

see also [#camel > probable bug in log masking 
configuration|https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/probable.20bug.20in.20log.20masking.20configuration/with/599130635]

  was:
When registering a "CamelCustomLogMask" and using it by setting "logMask" 
property to "true" on a camel context like so, log endpoints are masked as 
expected:
{code:xml}
<camelContext xmlns="http://camel.apache.org/schema/spring"; logMask="true">
  ...
</camelContext>{code}
When trying to override that setting on a specific route inside the camel 
context by setting "logMask" to "false" there, there is no effect, logs are 
still masked:
{code:xml}
<route id="my/route" logMask="false">
  ...
  <to uri="log:com.company.my.out" />
</route>
{code}
What actually DOES work is setting it as a query parameter on the endpoint 
inside the route like so:
{code:xml}
<route id="my/route">
  <to uri="log:com.company.my.out?logMask=false" />
</route>{code}
I would expect the setting on the route to override the global one of the camel 
context.

see also [#camel > probable bug in log masking 
configuration|https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/probable.20bug.20in.20log.20masking.20configuration/with/599130635]


> logMask of camel context not overridden in route
> ------------------------------------------------
>
>                 Key: CAMEL-23662
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23662
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 4.20.0
>         Environment: Spring Boot 4
> OpenJDK 21
>            Reporter: Erich Mauerböck
>            Priority: Major
>
> When registering a "CamelCustomLogMask" and using it by setting "logMask" 
> property to "true" on a camel context like so, log endpoints are masked as 
> expected:
> {code:xml}
> <bean id="CamelCustomLogMask" 
> class="com.company.my.formatter.CustomMaskingFormatter" />
> <camelContext xmlns="http://camel.apache.org/schema/spring"; logMask="true">
>   ...
> </camelContext>{code}
> When trying to override that setting on a specific route inside the camel 
> context by setting "logMask" to "false" there, there is no effect, logs are 
> still masked:
> {code:xml}
> <route id="my/route" logMask="false">
>   ...
>   <to uri="log:com.company.my.out" />
> </route>
> {code}
> What actually DOES work is setting it as a query parameter on the endpoint 
> inside the route like so:
> {code:xml}
> <route id="my/route">
>   <to uri="log:com.company.my.out?logMask=false" />
> </route>{code}
> I would expect the setting on the route to override the global one of the 
> camel context.
> see also [#camel > probable bug in log masking 
> configuration|https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/probable.20bug.20in.20log.20masking.20configuration/with/599130635]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to