serilog / serilog-enrichers-environment

Enrich Serilog log events with properties from System.Environment.
Apache License 2.0
80 stars 33 forks source link

Add enricher for Thread identity name #16

Closed osudude closed 7 years ago

osudude commented 7 years ago

Many of our apps use claims based authentication where the Thread Principal is set via middleware and drilling down to the name reveals the current user. This is helpful when troubleshooting logs. Note, this probably will required serilog to be able to inject an IHttpContextAccessor instance to the enricher constructor to be able to get at the current user. This could be done via middleware but thats painful.

nblumhardt commented 7 years ago

Thanks for the suggestion; sounds like an interesting approach, but could be a bit higher-level than what we're doing in the Serilog.* packages so far. Maybe a good one to post as a Gist somewhere, and write a quick blog post/intro for? (Just thinking aloud - not always easy to figure out the right release vehicle for these... :-))

osudude commented 7 years ago

Closing this one due to cost beneft analysis 😀