-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support redaction through Microsoft.Extensions.Compliance.Redaction ? #373
Comments
Hi @zyofeng, thanks for dropping by! This would be nice to see 👍 It's not really in scope for this repository, and I'm not sure if any Serilog maintainers have time carved out for it right now; perhaps NZ Funds would be open to publishing this independently as an add-on package, in the same way that the Destructurama packages are published? |
Happy to take this one and create a separate package. |
Hi Mike, Yes, that's normally the case - when using Serilog.Extensions.Hosting, however, there's an builder.Services.AddSerilog((services, loggerConfiguration) => loggerConfiguration
.Destructure.WithRedaction(services.GetRequiredService<IRedactorFactory>())) (I'm not 100% sure of the parameter ordering etc., but this should be pretty close :-)) Keen to hear how you go, and please drop me a line if you need any more info. |
I've put something together, feedbacks are welcome https://github.com/zyofeng/serilog-redaction/tree/master/src |
Looks great! 👍 |
Currently I'm using Destructurama.Attributed to redact sensitive information in the logs.
That is quite static, and would be nice to be able to customize redaction using Microsoft.Extensions.Compliance.Redaction and more precisely through DataClassification attribute.
Something like this (adapted from Destructurama.Attributed):
The text was updated successfully, but these errors were encountered: