From f3b7a8a581ba22e31e96f6c8a76edfc24cb5852f Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Tue, 5 Mar 2013 23:49:45 +0600 Subject: [PATCH] Fixes: #U4-1471 - issue with having NewRelic installed and some sort of conflict with shutting down our logger. --- .../AsynchronousRollingFileAppender.cs | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs b/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs index 3d5bc51dad..56d04c8426 100644 --- a/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs +++ b/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs @@ -64,23 +64,28 @@ namespace Umbraco.Core.Logging { _forceStop = true; var windowsIdentity = WindowsIdentity.GetCurrent(); - base.Append(new LoggingEvent(new LoggingEventData - { - Level = Level.Error, - Message = - "Unable to clear out the AsynchronousRollingFileAppender buffer in the allotted time, forcing a shutdown", - TimeStamp = DateTime.UtcNow, - Identity = "", - ExceptionString = "", - UserName = windowsIdentity != null ? windowsIdentity.Name : "", - Domain = AppDomain.CurrentDomain.FriendlyName, - ThreadName = Thread.CurrentThread.ManagedThreadId.ToString(), - LocationInfo = - new LocationInfo(this.GetType().Name, "OnClose", "AsynchronousRollingFileAppender.cs", "59"), - LoggerName = this.GetType().FullName, - Properties = new PropertiesDictionary(), - }) - ); + + var logEvent = new LoggingEvent(new LoggingEventData + { + Level = global::log4net.Core.Level.Error, + Message = + "Unable to clear out the AsynchronousRollingFileAppender buffer in the allotted time, forcing a shutdown", + TimeStamp = DateTime.UtcNow, + Identity = "", + ExceptionString = "", + UserName = windowsIdentity != null ? windowsIdentity.Name : "", + Domain = AppDomain.CurrentDomain.FriendlyName, + ThreadName = Thread.CurrentThread.ManagedThreadId.ToString(), + LocationInfo = + new LocationInfo(this.GetType().Name, "OnClose", "AsynchronousRollingFileAppender.cs", "59"), + LoggerName = this.GetType().FullName, + Properties = new PropertiesDictionary(), + }); + + if (this.DateTimeStrategy != null) + { + base.Append(logEvent); + } } base.OnClose();