serilog-contrib/serilog-sinks-azuretablestorage

Changing Exception Message

Closed this issue · 1 comments

Hello!
For security reason i need to hash all emails in logs.
I have a problem when i am sending an "Information" log which got exception. Its not a property so AzureTableStorageWithProperties can't help me :/

Exception is read only and i cant change its value.

Earlier I got the same problem when i was writing logs to file but there i just made a new propertie (which was exception message with hashed email) and change outPutTemplate to not use exception but to use my own property

const string logOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} " + "<{ThreadId}>{NewLine}{ExceptionWithHiddenEmail}";

Maybe you got any idea how to do it? Is it possible to not write to AzureStorage Informations like: Level/Exception?

The sink has been rewritten in version 8. You can now fully customize the document created from the log event by implementing IDocumentFactory.