Closed SViradiya-MarutiTech closed 1 year ago
I’m not sure what you’re trying to achieve here. It looks like you want to configure the sink to not mask anything at all?
Could you give me some idea about the use case you’re looking for?
We have one common logging library where we read json configuration from AWS SSM, and configure Serilog. this library is shared to all other products to integrate. with this Enrichers we decided to we would override default behavior to not mask anything now, we will create one extension method which will take list of properties to mask and configure it in Sensitive enricher using WithSensitiveDataLogging method.
If we set every thing in JSON then we would need to update library every time when new properties are added from product teams, thats why we want to make c# configuration to mask properties on demand.
Let me know if you have suggestions.
I've managed to get it to work. Took a bit of debugging the Serilog configuration package to figure out how to do it.
Version 1.7.1 will land soon and that will allow you to set masking operators (and the other options) from an appsettings.json
file.
Release is out: see here Should be available through NuGet shortly.
Hi I was checking to clear default behavior of this Enrichers to not mask any thing as default. and provide list of properties to mask in C# configuration.
I was providing Json as below for testing.
when testing with
_logger.LogInformation("This is a secret email address: {Email}", "james.bond@universal-exports.co.uk");
or_logger.LogInformation("This is a secret email address: james.bond@universal-exports.co.uk");
It logs
This is a secret email address: **