I am looking into Serilog as an alternative to log4net (I have an issue where log4net stops logging with no clear way to recover from this). This is c#, mainly WinForms.
First, here are the app.config settings:
<add key="serilog:write-to:RollingFile.pathFormat" value="q:\SomeApp-%COMPUTERNAME%-log-{Date}.txt" />
<add key="serilog:write-to:RollingFile.outputTemplate" value="{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level}] {Message}{NewLine}{Exception}" />
<add key="serilog:write-to:File.rollOnFileSizeLimit" value="true" />
<add key="serilog:write-to:File.fileSizeLimitBytes" value="10485760" />
<add key="serilog:write-to:File.retainedFileCountLimit" value="10" />
<add key="serilog:minimum-level" value="Information" />
In the C# app, I create the logger like this:
Log.Logger = new LoggerConfiguration()
.ReadFrom.AppSettings()
.CreateLogger();
Question: CreateLogger gives no indication of an issue even when I specify an invalid path in "serilog:write-to:RollingFile.pathFormat" above, but of course nothing gets logged.
Logging is critical, so if it does not work I need to know about it. How can I tell?