Open
Description
ConfigureLogging(Action<ILoggerFactory>)
has been removed from the IWebHostBuilder
interface in aspnet/Hosting#1007.
The recommendation is to use the overload of ConfigureLogging
that takes in a concrete type of ILoggerFactory
with the signature ConfigureLogging<T>(Action<WebHostBuilderContext, T>) where T : ILoggerFactory
added in aspnet/Hosting#955. For example:
var host = new WebHostBuilder()
.UseLoggerFactory(new CustomLoggerFactory())
.ConfigureLogging<CustomLoggerFactory>((hostingContext, factory) =>
{
factory.UseConfiguration(hostingContext.Configuration.GetSection("Logging"));
factory.AddConsole();
})
...
An alternative would be to use the newly added extension ConfigureLogging(Action<LoggerFactory>)
to configure the default LoggerFactory
implementation, for example:
var host = new WebHostBuilder()
.ConfigureLogging(factory => factory.AddConsole())
...
See aspnet/Hosting#1069 for discussion