I have a project that utilizes a 3rd party software which uses Serilog. For that purpose I added the following to my Startup method in Startup.cs file.
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.ReadFrom.ConfigurationSection(Configuration.GetSection("Logging:Serilog"))
.CreateLogger();
On a separate project, I have service layer that uses a logging mechanism based on Microsoft.Extensions.Logging.ILogger.
Now I am adding UI to my initial project and I am injecting Microsoft.Extensions.Logging.ILogger to my controller classes through Service Collection; which I will then use (inside controllers) to create service layer objects.
The challange is; I would like to inject the existing Serilog logger into these controllers. Couldn't find a neat way of adding it to my service collection so that the controllers can fetch through DI. Any suggestions?