Skip to content

Instantly share code, notes, and snippets.

@augustoproiete
Forked from nblumhardt/gist:07c8046ffdcbd3d6b1fa
Last active November 30, 2015 18:54
Show Gist options
  • Save augustoproiete/7e37ab5209a1a47d6ab0 to your computer and use it in GitHub Desktop.
Save augustoproiete/7e37ab5209a1a47d6ab0 to your computer and use it in GitHub Desktop.
Configuring Serilog w/ AppSettings and Seq

1. Install Serilog.Extras.AppSettings

PM> Install-Package Serilog.Extras.AppSettings

2. Add the 'read' method to logger config

... = new LoggerConfiguration()
  .ReadAppSettings()
  ... // Other config

3. Add using/server URL keys

In x.config, add two (or more) app settings keys:

<appSettings>
  <add key="serilog:using" value="Serilog.Sinks.Seq" />
  <add key="serilog:write-to:Seq.serverUrl" value="http://my-seq:5341" />
</appSettings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment