I'm building an API using .NET 6 and plan to use Serilog as logger. According to https://onloupe.com/blog/serilog-vs-mel/ there are two possibilities:
- Use Serilog exclusively
- Use Microsoft.Extensions.Logging as logging API + Serilog as logging framework
On the one hand, using Serilog exclusively has the drawback that everything in my codebase would take a dependency on Serilog, so using it in combination with Microsoft.Extensions.Logging should provide more flexibility.
On the other hand, on https://github.com/serilog/serilog-extensions-logging they clearly recommend to use https://github.com/serilog/serilog-aspnetcore for .NET Core projects:
ASP.NET Core applications should prefer Serilog.AspNetCore and UseSerilog() instead.
Does anybody know the reason for this recommendation which looks contradictory to me in terms of flexibility?