Using anonymous types and tuples to attach correlation IDs to scope state with Serilog and Seq in ASP.NET Core

added by DotNetKicks
9/26/2017 11:19:23 AM

2 Kicks, 100 Views

In my last post I gave an introduction to structured logging, and described how you can use scopes to add additional key-value pairs to log messages. Unfortunately, the syntax for key-value pairs using ILogger.BeginScope() can be a bit verbose, so I showed an extension method you can use to achieve the same result with a terser syntax.