I am using ServiceStack.Text
and ServiceStack.Logging.NLog
to log the DTO requests sent to/from a web service from a .NET client application. While the machines are generally secure, I'd like to redact sensitive information that might be stored in plain-text (think name, address, basic auth creds, etc.).
I've looked at the various JsConfig<T>
methods, but it seems like I'd have to implement a SerializeFn<T>
for every DTO. There is risk in "missing one", and I'd want to apply it only to the scope of logging.
I've looked at NLog
filters, and when
just changes whether the message is logged.
Is there some universal way to replace sensitive properties/keys/attributes with a redaction marker when logging DTOs with ServiceStack.Logging
\ NLog
?