proudmonkey/ApiBoilerPlate

Why is Microsoft.Extensions.Logging used instead of Serilog?

Opened this issue · 1 comments

I've noticed that even though SeriLog is used in the projects, the usings are:

using Microsoft.Extensions.Logging;

instead of:

using Serilog

so that stuff like:

_logger = logger?.ForContext()

won't work.

Of course, you can change this in your own code (or the entire code if you want to) but I guess there is a reason for it being as it is?

Main reason for asking this is because we want to add custom Override to serilog like:

  "Override": {
    "Microsoft": "Warning",
    "System": "Warning",
    "System.Net.Http.HttpClient": "Information",
    "OurClassHere": "Debug"

and was not able to figure out how to do it which led us to this.

Thanks.

As far as I know, Serilog uses Microsoft.Extensions.Logging under the covers so it works seemingly with .NET Core. But, of course you can configure it to however you want.