Open
Description
I tried to use this in a console application but found that if I logged and exited immediately then the log file was not flushed, there was no opportunity to specify the dispose.
I ended up doing the below in the end.
// Set up Serilog
Log.Logger = new LoggerConfiguration()
.WriteTo.RollingFile(logFilename)
.CreateLogger();
// Add logging
services.AddSingleton(
new LoggerFactory()
.AddSerilog(dispose:true)
.AddConsole(loggingConfiguration)
.AddDebug(LogLevel.Trace)
);