I’m a big fan of structured logging in general and Serilog in particular. Especially in combination with Seq it is unbeatable.
Today I lost some time searching how to specify the Seq log sink using configuration. Here are the steps I had to take:
- Add the Serilog.Settings.Configuration NuGet package to your project(this one is for ASP.NET Core, others exists for web.config, …)
- Create a LoggerConfiguration:
- After that you can specify your configuration inside your appsettings.json: