Skip to content

Instantly share code, notes, and snippets.

Steffen Sun Lyng steffenlyng

  • Jyllands-Posten
  • Aarhus, Denmark
Block or report user

Report or block steffenlyng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steffenlyng
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)
return;
if (HttpContext.Current.Request == null)
You can’t perform that action at this time.