diff --git a/src/Umbraco.Core/UmbracoApplicationBase.cs b/src/Umbraco.Core/UmbracoApplicationBase.cs index 353879ec61..06847d0a5a 100644 --- a/src/Umbraco.Core/UmbracoApplicationBase.cs +++ b/src/Umbraco.Core/UmbracoApplicationBase.cs @@ -160,7 +160,10 @@ namespace Umbraco.Core _runtime = null; } - Current.Reset(); // dispose the container and everything + // dispose the container and everything + // but first, capture the looger! + var logger = Current.Logger; + Current.Reset(); if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted) return; @@ -183,12 +186,12 @@ namespace Umbraco.Core var shutdownMsg = $"Application shutdown. Details: {HostingEnvironment.ShutdownReason}\r\n\r\n_shutDownMessage={shutDownMessage}\r\n\r\n_shutDownStack={shutDownStack}"; - Current.Logger.Info(shutdownMsg); + logger.Info(shutdownMsg); } catch (Exception) { //if for some reason that fails, then log the normal output - Current.Logger.Info("Application shutdown. Reason: " + HostingEnvironment.ShutdownReason); + logger.Info("Application shutdown. Reason: " + HostingEnvironment.ShutdownReason); } }