Always log the hosting startup assemblies (#982)

This commit is contained in:
David Fowler 2017-03-22 20:57:01 -07:00 committed by GitHub
parent ddb1bfeb20
commit 32bed162a8
1 changed files with 9 additions and 11 deletions

View File

@ -122,17 +122,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
_logger.Started(); _logger.Started();
// REVIEW: Is this the right place to log these errors? // Log the fact that we did load hosting startup assemblies.
if (_hostingStartupErrors != null)
{
foreach (var exception in _hostingStartupErrors.InnerExceptions)
{
_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)) if (_logger.IsEnabled(LogLevel.Debug))
{ {
foreach (var assembly in _options.HostingStartupAssemblies) foreach (var assembly in _options.HostingStartupAssemblies)
@ -140,6 +130,14 @@ namespace Microsoft.AspNetCore.Hosting.Internal
_logger.LogDebug("Loaded hosting startup assembly {assemblyName}", assembly); _logger.LogDebug("Loaded hosting startup assembly {assemblyName}", assembly);
} }
} }
// REVIEW: Is this the right place to log these errors?
if (_hostingStartupErrors != null)
{
foreach (var exception in _hostingStartupErrors.InnerExceptions)
{
_logger.HostingStartupAssemblyError(exception);
}
} }
} }