Skip to content

[Discontinued] Serilog web request logging and enrichment for the Owin pipeline

License

Notifications You must be signed in to change notification settings

skrolikiewicz/owin

This branch is up to date with serilog-web/owin:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3a19891 · Sep 20, 2017

History

27 Commits
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Apr 7, 2015
Sep 20, 2017
Apr 7, 2015

Repository files navigation

SerilogWeb.Owin

Discontinued

This package has been discontinued due to the very minimal amount of code required to do this directly; to attach RequestId to Owin requests:

1. Enable LogContext

In your Serilog configuration, add Enrich.FromLogContext():

Log.Logger = new LoggerConfiguration()
    .Enrich.FromLogContext()
    // Other sink configuration etc.

2. Add the following Owin middleware

app.Use(new Func<AppFunc, AppFunc>(next => (async env =>
{
    using (LogContext.PushProperty("RequestId", Guid.NewGuid()))
        await next.Invoke(env);
})));

(For other ways to add middleware to Owin apps, see this post.

About

[Discontinued] Serilog web request logging and enrichment for the Owin pipeline

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 85.3%
  • PowerShell 14.7%