You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm wanting to use the serilog-aspnetcore package and am following instructions in the readme file but am stumbling on this line
Remove ILoggerFactory parameters and any Add*() calls on the logger factory in Startup.cs
I have this line in my startup.cs for registering a custom modelbinderprovider
services.AddMvc().AddMvcOptions(options => {
options.ModelBinderProviders.Insert(0, new GenericViewModelBinderProvider(loggerFactory));
})"
I need to pass an ILoggerFactory because GenericViewModelBinderProvider creates a new type of modelbinder which inherits from ComplexTypeModelBinder, which needs an ILoggerFactory.
My question is why do we need to remove ILoggerFactory parameters from the Startup.cs file. It would seem to me that if and what is the best method for getting the serilog logger factory within the configureservices method?