-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
Labels
Milestone
Description
When the configuration is like this:
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<jsonGeneratorDecorator class="net.logstash.logback.mask.MaskingJsonGeneratorDecorator">
<defaultMask>****</defaultMask>
<value>command</value>
</jsonGeneratorDecorator>
</encoder>
</appender>
It would mask only the string which is exactly "command".
For example log {"message":"command"} would be transformed into {"message":"****"}.
But it doesn't mask if word 'command' is part of the string.
For example log {"message":"Sending command bla"} would result in {"message":"Sending command bla"} and I would expect {"message":"Sending **** bla"}
I think it's because while checking if value matches logs, matches() method is used on Matcher, but should be used find()
Could you please take a look into this.
alinahorodetska, bhavin9695 and cleverton-heusnercleverton-heusner