From a277ac2fe4f9c296aa9eb850698111dc8c4a227c Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 8 Jul 2015 17:55:08 +0200 Subject: [PATCH] udpates some logging stuff which will also make logging faster. --- src/Umbraco.Core/CoreBootManager.cs | 4 +++- src/Umbraco.Core/Logging/LogHelper.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/CoreBootManager.cs b/src/Umbraco.Core/CoreBootManager.cs index c6591b7e47..f5dbdcf957 100644 --- a/src/Umbraco.Core/CoreBootManager.cs +++ b/src/Umbraco.Core/CoreBootManager.cs @@ -66,7 +66,9 @@ namespace Umbraco.Core InitializeProfilerResolver(); - _timer = DisposableTimer.TraceDuration("Umbraco application starting on '" + NetworkHelper.MachineName + "'", "Umbraco application startup complete"); + _timer = DisposableTimer.TraceDuration( + string.Format("Umbraco {0} application starting on {1}", UmbracoVersion.Current, NetworkHelper.MachineName), + "Umbraco application startup complete"); CreateApplicationCache(); diff --git a/src/Umbraco.Core/Logging/LogHelper.cs b/src/Umbraco.Core/Logging/LogHelper.cs index 14aab56f0b..05b9e7ed65 100644 --- a/src/Umbraco.Core/Logging/LogHelper.cs +++ b/src/Umbraco.Core/Logging/LogHelper.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using System.Threading; using System.Web; @@ -40,8 +41,11 @@ namespace Umbraco.Core.Logging /// private static string PrefixThreadId(string generateMessageFormat) { - return "[T" + Thread.CurrentThread.ManagedThreadId + "/D" + AppDomain.CurrentDomain.Id + "] " + generateMessageFormat; - } + return (_prefixThreadId ?? (_prefixThreadId = "[P" + Process.GetCurrentProcess().Id + "/T" + Thread.CurrentThread.ManagedThreadId + "/D" + AppDomain.CurrentDomain.Id + "] ")) + + generateMessageFormat; + } + + private static string _prefixThreadId = null; #region Error ///