serilog / serilog-extensions-logging

Serilog provider for Microsoft.Extensions.Logging
Apache License 2.0
307 stars 97 forks source link

Support IEnumerable<KeyValuePair<string, string>> in SerilogLoggerScope #193

Closed admalledd closed 9 months ago

admalledd commented 2 years ago

In EnrichAndCreateScopeItem() if my TState was originally created as Dictionary<string, string> the if statement fails to pivot my items into LogEvent.Properties as expected.

Similar to #186 but not quite, though if work on either is done, probably best to do both enhancements?

A reason why I am using <string, string> is that I want to be sure at time of BeginScope that all key/values are properly string-ified as expected for eventual SQL (or other tablized, like Splunk, AzureTableStorage...) column-store.

nblumhardt commented 9 months ago

Thanks for the suggestion; at this time I don't think there's enough momentum behind this usage to warrant making a change, but I can see how it would be a useful - thanks again for raising it, will keep it in mind in the future 👍