Description
I read in aspnet/Logging#182 this project will use the ILogger
implementation from Log.Logger
if none is specified.
I understand and appreciate the need for the static/global Log
; however, its seems out of place to me in cases where dependency injection is first class like in the ASP.NET 5 framework. There, it would seem more appropriate to get one from the IServiceProvider
that is used for dependency resolution.
While, the current implementation works and users can choose to resolve via the DI mechanism themselves; however, I am wondering whether it would be worthwhile to have an API where serilog-framework-logging would try to resolve/retrieve the ILogger before falling back to the static Log
. This could be an extension method on IApplicationBuilder
that uses IApplicationBuilder.ApplicationServices
meaning usage would be along the lines of app.UseSerilog()
.