I am using Serilog in both a class library and a .NET console application (C#). The logger is currently configured in the console application:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.File(
"verboseLog.txt",
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Verbose,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"
)
.CreateLogger();
I would like to conditionally configure it in the library if the caller has not configured it yet. (This library may be used with other applications in the future by other programmers.) Serilog's wiki on Github doesn't mention any default value for Log.Logger, and I haven't found an answer anywhere else. Is there a way to detect if the static Log.Logger has already been configured in Serilog?