Each log line includes a timestamp, RequestId from ASP.NET Core, the log level, message, and a unique event id. Events that have an associated Exception property will show this as well.

Why ship this package?

ASP.NET Core’s logging subsystem, Microsoft.Extensions.Logging, comes with a couple of simple providers that can log to the console and the .NET Debug class. More advanced logging features, and broader targets including databases, log servers and so-on are supported through complete providers like Serilog and NLog.

One place the pattern can fall short is in the early stages of project setup, when logging requirements are simple. At this stage, a one-liner like loggerFactory.AddFile() with sensible defaults could get the job done. Serilog configuration for .NET Core isn’t complex, but there are definitely some details that can be safely ignored in the early days of a new project.

That’s where Serilog.Extensions.Logging.File fits in. The goal of this package is to achieve that quick setup experience while maintainig a low-risk transition to the flexible LoggerConfiguration API when it’s needed.

There’s an element of experimentation in this approach and I’m very interested to see how it pans out. If you find this package useful, or have some feedback, please drop by the Gitter channel and let us know!