I am using Serilog for logging and cant\' figure out how to separate log events to different files. For example, I want to log errors to error_log-ddmmyyyy.txt and warnings
Another variant is to have ERROR and FATAL in one file (instead of errors in one file and fatal in another). Seems to many files for me having them separate. Just to keep in mind "or" operator can be used.
Log.Logger = new LoggerConfiguration()
.WriteTo.File("logs\\all.log", rollingInterval: RollingInterval.Day)
.WriteTo.Logger(
x => x.Filter.ByIncludingOnly(y => y.Level == Serilog.Events.LogEventLevel.Error || y.Level == Serilog.Events.LogEventLevel.Fatal)
.WriteTo.File("logs\\error.log", rollingInterval: RollingInterval.Day))
.CreateLogger();