Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit ad1d0cc

Browse files
committed
Pass configuration section to LoggerFactory
1 parent 1ae1ff0 commit ad1d0cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private IServiceCollection BuildCommonServices(out AggregateException hostingSta
267267
hostingContext.Configuration = configuration;
268268

269269
// The configured ILoggerFactory is added as a singleton here. AddLogging below will not add an additional one.
270-
var loggerFactory = _createLoggerFactoryDelegate?.Invoke(hostingContext) ?? new LoggerFactory();
270+
var loggerFactory = _createLoggerFactoryDelegate?.Invoke(hostingContext) ?? new LoggerFactory(configuration.GetSection("Logging"));
271271
services.AddSingleton(loggerFactory);
272272
hostingContext.LoggerFactory = loggerFactory;
273273

0 commit comments

Comments
 (0)