Serilog.Enrichers.Sensitive
Serilog.Enrichers.Sensitive copied to clipboard
Feature request - add customMaskingOperator option to items in maskProperties list.
Thought it would be a good idea, to say
options.MaskProperties.Add("_Password", PasswordMaskingOperator);
That way we can have the same extensiblity to say leave first and last char exposed?
Or maybe extending on the mask, rather than just a simple replace have some options?
options.MaskProperties.Add("_Password", new maskoptions {showFirst:2, showLast:2, preservelenght:true)});
(I admit taking inspiration from https://github.com/destructurama/attributed/blob/dev/src/Destructurama.Attributed/Attributed/LogMaskedAttribute.cs)
100% agree
I've taken a stab at this, have a look at WhenMaskingWithOptions.cs for how this will work.
There is a problem that this currently breaks the JSON configuration capabilities so this might change.