Refactored the error params, so that exception is before the message/template so its more in sync with Serilog signature & was an easy way to find some more logs I missed too

This commit is contained in:
Warren
2018-08-17 15:41:58 +01:00
parent 38984181fc
commit 9e996c68bb
98 changed files with 219 additions and 223 deletions

View File

@@ -122,13 +122,13 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
//See this thread: http://examine.cdodeplex.com/discussions/264341
//Catch the exception here for the time being, and just fallback to GetMedia
//TODO: Need to fix examine in LB scenarios!
Current.Logger.Error<PublishedMediaCache>("Could not load data from Examine index for media", ex);
Current.Logger.Error<PublishedMediaCache>(ex, "Could not load data from Examine index for media");
}
else if (ex is AlreadyClosedException)
{
//If the app domain is shutting down and the site is under heavy load the index reader will be closed and it really cannot
//be re-opened since the app domain is shutting down. In this case we have no option but to try to load the data from the db.
Current.Logger.Error<PublishedMediaCache>("Could not load data from Examine index for media, the app domain is most likely in a shutdown state", ex);
Current.Logger.Error<PublishedMediaCache>(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state");
}
else throw;
}
@@ -306,13 +306,13 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
//See this thread: http://examine.cdodeplex.com/discussions/264341
//Catch the exception here for the time being, and just fallback to GetMedia
//TODO: Need to fix examine in LB scenarios!
Current.Logger.Error<PublishedMediaCache>("Could not load data from Examine index for media", ex);
Current.Logger.Error<PublishedMediaCache>(ex, "Could not load data from Examine index for media");
}
else if (ex is AlreadyClosedException)
{
//If the app domain is shutting down and the site is under heavy load the index reader will be closed and it really cannot
//be re-opened since the app domain is shutting down. In this case we have no option but to try to load the data from the db.
Current.Logger.Error<PublishedMediaCache>("Could not load data from Examine index for media, the app domain is most likely in a shutdown state", ex);
Current.Logger.Error<PublishedMediaCache>(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state");
}
else throw;
}