Logging in ASP NET Core with Serilog
Logging in ASP NET Core with Serilog At each stages of an application development cycle, good logs are necessary to debug and fix bugs efficiently. Serilog is a logging framework allowing developers to log structured logs into different ouput platforms. Today we will see how we can set it up in three parts Serilog for ASP.NET Core Console sink Rolling File sink Environment enricher All the code discussed here can be found on my GitHub https://github.com/Kimserey/SerilogTest . 1. Serilog for ASP.NET Core 1.1 Structured logs Logs are string messages describing an event in the system. They are built by assembling pieces of information, elapsed time or process name, into a string message. Once constructed into a message, they are written into an ouput stream, console or file for example. The message contains the timestamp the log message. The log message being a string, all we can do to query it is a full text search query. If our log contained the elapsed time, it would n...