From 1a03bd9624b640d0d02f3613a2adce27cd2ea4f8 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 30 Mar 2017 15:49:45 +1100 Subject: [PATCH] Logs an error if the index is rebuilding due to being corrupt --- src/Umbraco.Web/WebBootManager.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index bc41c9c877..38f896381f 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -579,6 +579,15 @@ namespace Umbraco.Web // is complete and cancel this current event so the rebuild process doesn't start right now. args.Cancel = true; IndexesToRebuild.Add((BaseIndexProvider)args.Indexer); + + //check if the index is rebuilding due to an error and log it + if (args.IsHealthy == false) + { + var baseIndex = args.Indexer as BaseIndexProvider; + var name = baseIndex != null ? baseIndex.Name : "[UKNOWN]"; + + ProfilingLogger.Logger.Error(string.Format("The index {0} is rebuilding due to being unreadable/corrupt", name), args.UnhealthyException); + } } } }