-
We'd like to log as little sensitive information as possible. However, we also noticed that we do need certain information in error cases. Currently, we make this work by only setting the information in the error case, but that leads to inconsistencies. What I'd love to do is to save even sensitive information automatically, all the time, in the I have not found any information on whether masking (or another mechanism) can do this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
While logstash-logback-encoder does not have first-class support for this use case, you can accomplish it by creating a custom If the sensitive information is contained within well-known MDC properties, then take the following approach:
|
Beta Was this translation helpful? Give feedback.
While logstash-logback-encoder does not have first-class support for this use case, you can accomplish it by creating a custom
JsonProvider
.If the sensitive information is contained within well-known MDC properties, then take the following approach:
excludeMdcKeyName
. See here or here, depending on which encoder you are using.JsonProvider
that inspects the log level of the LoggingEvent, and writes those sensitive MDC fields only if the log level is error