logstash-logback-encoder icon indicating copy to clipboard operation
logstash-logback-encoder copied to clipboard

Option to serialize nonStructuredArguments using toString

Open schmidti159 opened this issue 2 years ago • 1 comments

As described in https://github.com/logfellow/logstash-logback-encoder/issues/304 all arguments are serialized using jackson when includeNonStructuredArguments=true is set.

This might expose sensitive data through logging as not all developers might be aware that the complete object is serialized.

It would be great to have a separate configuration like serializeNonStructuredArguments (default true). If it is set to false the arguments will not be serialized with jackson but toString will be used.

This enables the opportunity to enable includeNonStructuredArguments=true for legacy code bases where it is not feasible to analyze all existing log messages.

Does it make sense to you to add this to this lib? If yes, I could provide a PR.

schmidti159 avatar Sep 04 '23 09:09 schmidti159

Makes sense. Contributions welcome.

I'd prefer the new flag to be named writeNonStructuredArgumentsAsString, default false.

philsttr avatar Jul 27 '24 20:07 philsttr