From 32bed162a88d0a53184b67b7e7b5967b1dbb6ed5 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 22 Mar 2017 20:57:01 -0700 Subject: [PATCH] Always log the hosting startup assemblies (#982) --- .../Internal/WebHost.cs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs b/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs index ffc3501c8b..5bf36c5676 100644 --- a/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs +++ b/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs @@ -122,6 +122,15 @@ namespace Microsoft.AspNetCore.Hosting.Internal _logger.Started(); + // Log the fact that we did load hosting startup assemblies. + if (_logger.IsEnabled(LogLevel.Debug)) + { + foreach (var assembly in _options.HostingStartupAssemblies) + { + _logger.LogDebug("Loaded hosting startup assembly {assemblyName}", assembly); + } + } + // REVIEW: Is this the right place to log these errors? if (_hostingStartupErrors != null) { @@ -130,17 +139,6 @@ namespace Microsoft.AspNetCore.Hosting.Internal _logger.HostingStartupAssemblyError(exception); } } - else - { - // If there were no errors then just log the fact that we did load hosting startup assemblies. - if (_logger.IsEnabled(LogLevel.Debug)) - { - foreach (var assembly in _options.HostingStartupAssemblies) - { - _logger.LogDebug("Loaded hosting startup assembly {assemblyName}", assembly); - } - } - } } private void EnsureApplicationServices()