I wish I could process my code using Serilog and Microsoft.Extensions.Logging (ILogger). And let them both be configured the same way, so they write the same "sinks". I have an ASPNET Core application with running logs and some dependent libraries using Serilog that I would like to get from the log output (in the same place as the ASPNET Core application).
I know that there is a nuget package for using Serilog registration with ASPNET Core applications. However this is a private extension
(WebAppBuilder).UseSerilog()
There is an opportunity to completely replace the existing ILoggerFactory version with serilog, and this will stop my ASPNET log. That would be fine if I could just plug in the serilog configuration so that it works like the original ASPNET Core engine. However, Serilog.Settings.Configuration does not seem to copy the configuration to Serilog.
I am also worried that they cannot use the shared resource, what if I use other libraries that use, say, NLog, how do I integrate this into the same logging infrastructure?
Is it possible to configure Serilog in the same way as Microsoft.Extensions.Logging? And if so, how is this achieved?
source
share