Skip to content

Instantly share code, notes, and snippets.


Steffen Mads Lyng steffenlyng

  • Aarhus, Denmark
View GitHub Profile
steffenlyng / CorrelationIdEnricher.cs
Created Aug 11, 2015
Create Serilog Enricher to add Request header in logs
View CorrelationIdEnricher.cs
public class CorrelationIdEnricher : ILogEventEnricher
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
if (logEvent == null) throw new ArgumentNullException("logEvent");
if (HttpContext.Current == null)
if (HttpContext.Current.Request == null)