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
I think you need:
.ByIncludingOnly(evt => evt.Level == LogEventLevel.Warning)
Edit:
In many cases it's now more succinct to use Serilog.Sinks.Map. With it, the example can be written as:
Log.Logger = new LoggerConfiuration()
.WriteTo.Map(
evt => evt.Level,
(level, wt) => wt.RollingFile("Logs\\" + level + "-{Date}.log"))
.CreateLogger();