serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
276 stars 147 forks source link

Property-rendering delegates #163

Open MV10 opened 5 years ago

MV10 commented 5 years ago

For supporting the more complex SQL column types (image or varbinary, for example) in specialized logging scenarios, I've been considering a callback mechanism for rendering property values.

The only drawback that comes to mind is that log properties aren't rendered until the batch is written. This deferred rendering could be addressed by writing an application-specific identifier with the log event which is passed to the rendering delegate.

The implementation appears relatively simple, but I'm not going to tag this as a feature request yet. I'd like to hear if anyone has thoughts about this idea.

ckadluba commented 4 years ago

Sounds very interesting.

Do I understand this right, that the application specific id is used to find the matching delegate when a property is rendered? If the rendering delegate could be set in ColumnOptions.AdditionalColumns for each property, could we then do without an application-specific id?