Minimum Log Level in Serilog

Serilog defines several levels of log events. From low to high, these are Verbose, Debug, Information, Warning, Error and Fatal.

Level Usage
Verbose Verbose is the noisiest level, rarely (if ever) enabled for a production app.
Debug Debug is used for internal system events that are not necessarily observable from the outside, but useful when determining how something happened.
Information Information events describe things happening in the system that correspond to its responsibilities and functions. Generally these are the observable actions the system can perform.
Warning When service is degraded, endangered, or may be behaving outside of its expected parameters, Warning level events are used.
Error When functionality is unavailable or expectations broken, an Error event is used.
Fatal The most critical level, Fatal events demand immediate attention.

Default Level – if no MinimumLevel is specified, then Information level events and higher will be processed.


Setting up Serilog in .NET 6 for ASP.NET


builder.Host.UseSerilog((ctx, lc) => lc
    .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
    .WriteTo.File("logs/log-.txt", rollingInterval: RollingInterval.Day)