Is there any way to replace the feign header 's value as "secret"?
Is there any way to replace the feign header's value in log ? I found the way to exclude headers from logs but I want to replace feign header's value as "secret" .I did this by overriding shouldLogRequestHeader method
if you want to exclude secret values from the logs, why not configure your logger to mask those. We use logback and use pathMask and valueMask to mask sensitive values in the log.
if you want to exclude secret values from the logs, why not configure your logger to mask those. We use
logbackand usepathMaskandvalueMaskto mask sensitive values in the log.
I use logbook for project but logbook. removeheader does not affect feign log ,because feign log use slf4J by default when it is logging.And So I can see sensitive data in log when request sent. Can Logback framework do it for feign log that automatcally logged?
I found (https://github.com/OpenFeign/feign/pull/1530)this .It is exculude but I want to replace with"secret"
@MGunel Logback can be used as implementation of slf4j: you can configure excluding as @sakibulalam said.
For me it is better way than to add masking logic to Feign's Logger.
Echoing @radio-rogal, You will need to provide your own Logger implementation for this sort of customized handling. Our provided Logger implementations do not allow for pattern customization at this time. Could be a good candidate for an enhancement. If this is something you are interested in, feel free to submit a proposal.
Given there's been no update or proposal, I'm assuming you are good.