You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using .Any I sometimes noticed reviewing/writing code that large structs are logged for debugging purposes but they might contain sensitive fields (that shouldn't be logged).
Was wondering if fields augmented with a sensitive or donotlog tag could be obfuscated with maybe *** or omitted when logging.
When logging individual fields its more likely that the developer notices a field is a token or a password and does not log it, but when using .Any it happens sometimes.
The text was updated successfully, but these errors were encountered:
My understanding is that Zap is a structured logging library. Therefore, .Any() should be used as little as possible, which reduces the possibility of logging sensitive data.
It's probably not reasonable for Zap to support any "contextual" understanding of the data in fields that will be logged. Instead, callers should do any scrubbing prior to adding that data to a Field.
It's possible that we could add "field preprocessors" that invoke a UDF prior to encoding (which would still require users to define that scrubbing logic themselves), but we don't have any plans for this at the moment. I'll keep this open to track.
When using
.Any
I sometimes noticed reviewing/writing code that large structs are logged for debugging purposes but they might contain sensitive fields (that shouldn't be logged).Was wondering if fields augmented with a
sensitive
ordonotlog
tag could be obfuscated with maybe***
or omitted when logging.When logging individual fields its more likely that the developer notices a field is a
token
or apassword
and does not log it, but when using.Any
it happens sometimes.The text was updated successfully, but these errors were encountered: