From d7e3bce741cdea936c70ba351c8d6e26a88459da Mon Sep 17 00:00:00 2001 From: Nikolaj Date: Mon, 14 Sep 2020 09:10:53 +0200 Subject: [PATCH] Rename Error to align it with MS ILogger --- .../Composing/ComponentCollection.cs | 2 +- src/Umbraco.Core/Composing/Composers.cs | 2 +- src/Umbraco.Core/Composing/TypeFinder.cs | 4 ++-- .../Configuration/Grid/GridEditorsConfig.cs | 2 +- .../HealthChecks/ConfigurationService.cs | 4 ++-- src/Umbraco.Core/IO/MediaFileSystem.cs | 2 +- src/Umbraco.Core/IO/PhysicalFileSystem.cs | 12 +++++------ src/Umbraco.Core/Logging/ConsoleLogger.cs | 10 +++++----- .../Logging/DebugDiagnosticsLogger.cs | 10 +++++----- src/Umbraco.Core/Logging/DisposableTimer.cs | 2 +- src/Umbraco.Core/Logging/ILogger.cs | 10 +++++----- src/Umbraco.Core/Logging/LoggerExtensions.cs | 20 +++++++++---------- src/Umbraco.Core/Logging/NullLogger.cs | 10 +++++----- src/Umbraco.Core/Logging/ProfilingLogger.cs | 20 +++++++++---------- .../Mapping/ContentPropertyBasicMapper.cs | 2 +- .../Packaging/PackageActionRunner.cs | 4 ++-- .../Routing/UrlProviderExtensions.cs | 2 +- src/Umbraco.Core/Runtime/MainDom.cs | 2 +- src/Umbraco.Core/Scheduling/KeepAlive.cs | 2 +- .../Scheduling/TempFileCleanup.cs | 2 +- .../UmbracoExamineIndex.cs | 2 +- ...aseServerRegistrarAndMessengerComponent.cs | 4 ++-- .../Examine/IndexRebuilder.cs | 2 +- .../Examine/MediaValueSetBuilder.cs | 2 +- .../HealthCheck/HealthCheckResults.cs | 2 +- .../Install/InstallHelper.cs | 4 ++-- .../InstallSteps/DatabaseConfigureStep.cs | 2 +- .../Logging/Serilog/SerilogLogger.cs | 10 +++++----- .../Logging/Viewer/SerilogJsonLogViewer.cs | 2 +- .../Manifest/ManifestParser.cs | 2 +- .../Media/UploadAutoFillProperties.cs | 2 +- .../Migrations/Install/DatabaseBuilder.cs | 2 +- .../Install/DatabaseSchemaCreator.cs | 2 +- .../DropDownPropertyEditorsMigration.cs | 2 +- .../MergeDateAndDateTimePropertyEditor.cs | 2 +- ...adioAndCheckboxPropertyEditorsMigration.cs | 2 +- .../Models/Mapping/PropertyTypeGroupMapper.cs | 2 +- .../Packaging/PackageDataInstallation.cs | 8 ++++---- .../Implement/ContentTypeRepository.cs | 2 +- .../Implement/ContentTypeRepositoryBase.cs | 4 ++-- .../SqlSyntax/SqlServerSyntaxProvider.cs | 2 +- .../Persistence/UmbracoDatabase.cs | 2 +- .../ImageCropperPropertyEditor.cs | 2 +- .../MultiUrlPickerValueEditor.cs | 4 ++-- .../RichTextEditorPastedImages.cs | 2 +- .../ValueConverters/GridValueConverter.cs | 2 +- .../ImageCropperValueConverter.cs | 2 +- .../ValueConverters/JsonValueConverter.cs | 2 +- .../Routing/NotFoundHandlerHelper.cs | 2 +- .../Runtime/CoreRuntime.cs | 2 +- .../Runtime/MainDomSemaphoreLock.cs | 2 +- .../Runtime/SqlMainDomLock.cs | 16 +++++++-------- .../Scheduling/BackgroundTaskRunner.cs | 6 +++--- .../Scheduling/LogScrubber.cs | 2 +- .../Scheduling/ScheduledPublishing.cs | 2 +- .../Search/BackgroundIndexRebuilder.cs | 2 +- .../Services/Implement/ContentService.cs | 10 +++++----- .../LocalizedTextServiceFileSources.cs | 2 +- .../Services/Implement/NotificationService.cs | 2 +- .../Sync/DatabaseServerMessenger.cs | 4 ++-- .../LiveModelsProvider.cs | 2 +- .../PureLiveModelFactory.cs | 2 +- .../ContentStore.cs | 4 ++-- .../LegacyXmlPublishedCache/PreviewContent.cs | 4 ++-- .../PublishedMediaCache.cs | 8 ++++---- .../LegacyXmlPublishedCache/XmlStore.cs | 8 ++++---- .../TestHelpers/TestWithDatabaseBase.cs | 2 +- .../Controllers/ContentController.cs | 2 +- .../Controllers/ContentTypeController.cs | 2 +- .../Controllers/DashboardController.cs | 6 +++--- .../Controllers/DictionaryController.cs | 4 ++-- .../ExamineManagementController.cs | 2 +- .../Controllers/MacrosController.cs | 4 ++-- .../Controllers/MediaController.cs | 2 +- .../Controllers/PackageInstallController.cs | 2 +- .../Controllers/RelationTypeController.cs | 4 ++-- .../FileUploadCleanupFilterAttribute.cs | 4 ++-- ...alidateAngularAntiForgeryTokenAttribute.cs | 2 +- .../HealthCheck/HealthCheckController.cs | 2 +- .../PropertyEditors/RteEmbedController.cs | 2 +- .../ImageCropperTemplateExtensions.cs | 2 +- .../Install/InstallApiController.cs | 6 +++--- .../Install/InstallAuthorizeAttribute.cs | 2 +- .../Middleware/UmbracoRequestMiddleware.cs | 6 +++--- src/Umbraco.Web/CdfLogger.cs | 4 ++-- src/Umbraco.Web/ImageProcessorLogger.cs | 4 ++-- src/Umbraco.Web/Logging/OwinLogger.cs | 2 +- .../Mvc/AdminTokenAuthorizeAttribute.cs | 2 +- .../AuthenticationOptionsExtensions.cs | 2 +- .../Security/MembershipProviderBase.cs | 2 +- src/Umbraco.Web/UmbracoApplicationBase.cs | 4 ++-- .../Filters/AngularAntiForgeryHelper.cs | 2 +- .../FileUploadCleanupFilterAttribute.cs | 6 +++--- .../WebApi/UnhandledExceptionLogger.cs | 2 +- .../CDF/ClientDependencyConfiguration.cs | 6 +++--- 95 files changed, 187 insertions(+), 187 deletions(-) diff --git a/src/Umbraco.Core/Composing/ComponentCollection.cs b/src/Umbraco.Core/Composing/ComponentCollection.cs index 62b240f10f..a0c02c191b 100644 --- a/src/Umbraco.Core/Composing/ComponentCollection.cs +++ b/src/Umbraco.Core/Composing/ComponentCollection.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Composing } catch (Exception ex) { - _logger.Error(ex, "Error while terminating component {ComponentType}.", componentType.FullName); + _logger.LogError(ex, "Error while terminating component {ComponentType}.", componentType.FullName); } } } diff --git a/src/Umbraco.Core/Composing/Composers.cs b/src/Umbraco.Core/Composing/Composers.cs index 004c2527e6..86c994c557 100644 --- a/src/Umbraco.Core/Composing/Composers.cs +++ b/src/Umbraco.Core/Composing/Composers.cs @@ -184,7 +184,7 @@ namespace Umbraco.Core.Composing { // in case of an error, force-dump everything to log _logger.Info("Composer Report:\r\n{ComposerReport}", GetComposersReport(requirements)); - _logger.Error(e, "Failed to sort composers."); + _logger.LogError(e, "Failed to sort composers."); throw; } diff --git a/src/Umbraco.Core/Composing/TypeFinder.cs b/src/Umbraco.Core/Composing/TypeFinder.cs index 3427c55731..82c5bdba9d 100644 --- a/src/Umbraco.Core/Composing/TypeFinder.cs +++ b/src/Umbraco.Core/Composing/TypeFinder.cs @@ -297,7 +297,7 @@ namespace Umbraco.Core.Composing } catch (TypeLoadException ex) { - _logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); + _logger.LogError(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); continue; } @@ -372,7 +372,7 @@ namespace Umbraco.Core.Composing } catch (TypeLoadException ex) { - _logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); + _logger.LogError(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); continue; } diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs index 6cf985fecb..882d9073a9 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs @@ -47,7 +47,7 @@ namespace Umbraco.Core.Configuration.Grid } catch (Exception ex) { - _logger.Error(ex, "Could not parse the contents of grid.editors.config.js into a JSON array '{Json}", sourceString); + _logger.LogError(ex, "Could not parse the contents of grid.editors.config.js into a JSON array '{Json}", sourceString); } } diff --git a/src/Umbraco.Core/Configuration/HealthChecks/ConfigurationService.cs b/src/Umbraco.Core/Configuration/HealthChecks/ConfigurationService.cs index a4554a52fd..d8b4eb6c99 100644 --- a/src/Umbraco.Core/Configuration/HealthChecks/ConfigurationService.cs +++ b/src/Umbraco.Core/Configuration/HealthChecks/ConfigurationService.cs @@ -61,7 +61,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } catch (Exception ex) { - _logger.Error(ex, "Error trying to get configuration value"); + _logger.LogError(ex, "Error trying to get configuration value"); return new ConfigurationServiceResult { Success = false, @@ -107,7 +107,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } catch (Exception ex) { - _logger.Error(ex, "Error trying to update configuration"); + _logger.LogError(ex, "Error trying to update configuration"); return new ConfigurationServiceResult { Success = false, diff --git a/src/Umbraco.Core/IO/MediaFileSystem.cs b/src/Umbraco.Core/IO/MediaFileSystem.cs index 1df4e4a0fb..a16c9822c8 100644 --- a/src/Umbraco.Core/IO/MediaFileSystem.cs +++ b/src/Umbraco.Core/IO/MediaFileSystem.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.IO } catch (Exception e) { - _logger.Error(e, "Failed to delete media file '{File}'.", file); + _logger.LogError(e, "Failed to delete media file '{File}'.", file); } }); } diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index aa9d6174dd..22dfd8c43e 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -87,11 +87,11 @@ namespace Umbraco.Core.IO } catch (UnauthorizedAccessException ex) { - _logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); + _logger.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - _logger.Error(ex, "Directory not found for '{Path}'", fullPath); + _logger.LogError(ex, "Directory not found for '{Path}'", fullPath); } return Enumerable.Empty(); @@ -123,7 +123,7 @@ namespace Umbraco.Core.IO } catch (DirectoryNotFoundException ex) { - _logger.Error(ex, "Directory not found for '{Path}'", fullPath); + _logger.LogError(ex, "Directory not found for '{Path}'", fullPath); } } @@ -203,11 +203,11 @@ namespace Umbraco.Core.IO } catch (UnauthorizedAccessException ex) { - _logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); + _logger.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - _logger.Error(ex, "Directory not found for '{FullPath}'", fullPath); + _logger.LogError(ex, "Directory not found for '{FullPath}'", fullPath); } return Enumerable.Empty(); @@ -240,7 +240,7 @@ namespace Umbraco.Core.IO } catch (FileNotFoundException ex) { - _logger.Error(ex.InnerException, "DeleteFile failed with FileNotFoundException for '{Path}'", fullPath); + _logger.LogError(ex.InnerException, "DeleteFile failed with FileNotFoundException for '{Path}'", fullPath); } } diff --git a/src/Umbraco.Core/Logging/ConsoleLogger.cs b/src/Umbraco.Core/Logging/ConsoleLogger.cs index 275b8d988b..b4911d489d 100644 --- a/src/Umbraco.Core/Logging/ConsoleLogger.cs +++ b/src/Umbraco.Core/Logging/ConsoleLogger.cs @@ -42,30 +42,30 @@ namespace Umbraco.Core.Logging Console.WriteLine("FATAL {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues)); } - public void Error(Type reporting, Exception exception, string message) + public void LogError(Type reporting, Exception exception, string message) { Console.WriteLine("ERROR {0} - {1}", reporting.Name, message); Console.WriteLine(exception); } - public void Error(Type reporting, Exception exception) + public void LogError(Type reporting, Exception exception) { Console.WriteLine("ERROR {0}", reporting.Name); Console.WriteLine(exception); } - public void Error(Type reporting, string message) + public void LogError(Type reporting, string message) { Console.WriteLine("ERROR {0} - {1}", reporting.Name, message); } - public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) { Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues)); Console.WriteLine(exception); } - public void Error(Type reporting, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) { Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues)); } diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index 552daba713..1c3af3b36b 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -48,31 +48,31 @@ namespace Umbraco.Core.Logging } /// - public void Error(Type reporting, Exception exception, string message) + public void LogError(Type reporting, Exception exception, string message) { System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName); } /// - public void Error(Type reporting, Exception exception) + public void LogError(Type reporting, Exception exception) { System.Diagnostics.Debug.WriteLine(Environment.NewLine + exception, reporting.FullName); } /// - public void Error(Type reporting, string message) + public void LogError(Type reporting, string message) { System.Diagnostics.Debug.WriteLine(message); } /// - public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) { System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(messageTemplate, propertyValues) + Environment.NewLine + exception, reporting.FullName); } /// - public void Error(Type reporting, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) { System.Diagnostics.Debug.WriteLine(messageTemplate, propertyValues); } diff --git a/src/Umbraco.Core/Logging/DisposableTimer.cs b/src/Umbraco.Core/Logging/DisposableTimer.cs index d854813b7d..9ae1dd8e71 100644 --- a/src/Umbraco.Core/Logging/DisposableTimer.cs +++ b/src/Umbraco.Core/Logging/DisposableTimer.cs @@ -84,7 +84,7 @@ namespace Umbraco.Core.Logging { if (_failed) { - _logger.Error(_loggerType, _failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId); + _logger.LogError(_loggerType, _failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId); } else switch (_level) { diff --git a/src/Umbraco.Core/Logging/ILogger.cs b/src/Umbraco.Core/Logging/ILogger.cs index fe7d798ebf..737b4c03f1 100644 --- a/src/Umbraco.Core/Logging/ILogger.cs +++ b/src/Umbraco.Core/Logging/ILogger.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Logging /// The reporting type. /// An exception. /// A message. - void Error(Type reporting, Exception exception, string message); + void LogError(Type reporting, Exception exception, string message); /// /// Logs an error exception. @@ -76,14 +76,14 @@ namespace Umbraco.Core.Logging /// The reporting type. /// An exception. /// The message string is unspecified and is implementation-specific. - void Error(Type reporting, Exception exception); + void LogError(Type reporting, Exception exception); /// /// Logs an error message. /// /// The reporting type. /// A message. - void Error(Type reporting, string message); + void LogError(Type reporting, string message); /// /// Logs an error message with an exception. @@ -92,7 +92,7 @@ namespace Umbraco.Core.Logging /// An exception. /// A message template. /// Property values. - void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); + void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); /// /// Logs an error message. @@ -100,7 +100,7 @@ namespace Umbraco.Core.Logging /// The reporting type. /// A message template. /// Property values. - void Error(Type reporting, string messageTemplate, params object[] propertyValues); + void LogError(Type reporting, string messageTemplate, params object[] propertyValues); /// /// Logs a warning message. diff --git a/src/Umbraco.Core/Logging/LoggerExtensions.cs b/src/Umbraco.Core/Logging/LoggerExtensions.cs index 3b105ed888..5b86e28946 100644 --- a/src/Umbraco.Core/Logging/LoggerExtensions.cs +++ b/src/Umbraco.Core/Logging/LoggerExtensions.cs @@ -23,8 +23,8 @@ namespace Umbraco.Core.Logging /// The logger. /// A message. /// An exception. - public static void Error(this ILogger logger, Exception exception, string message) - => logger.Error(typeof(T), exception, message); + public static void LogError(this ILogger logger, Exception exception, string message) + => logger.LogError(typeof(T), exception, message); /// /// Logs an error message with an exception. @@ -34,8 +34,8 @@ namespace Umbraco.Core.Logging /// An exception. /// A message template. /// Property values. - public static void Error(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) - => logger.Error(typeof(T), exception, messageTemplate, propertyValues); + public static void LogError(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) + => logger.LogError(typeof(T), exception, messageTemplate, propertyValues); /// /// Logs an error exception. @@ -43,8 +43,8 @@ namespace Umbraco.Core.Logging /// The reporting type. /// The logger. /// An exception. - public static void Error(this ILogger logger, Exception exception) - => logger.Error(typeof(T), exception); + public static void LogError(this ILogger logger, Exception exception) + => logger.LogError(typeof(T), exception); /// /// Logs an error message. @@ -52,8 +52,8 @@ namespace Umbraco.Core.Logging /// The reporting type. /// The logger. /// A message. - public static void Error(this ILogger logger, string message) - => logger.Error(typeof(T), message); + public static void LogError(this ILogger logger, string message) + => logger.LogError(typeof(T), message); /// /// Logs an error message. @@ -62,8 +62,8 @@ namespace Umbraco.Core.Logging /// The logger. /// A message template. /// Property values. - public static void Error(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.Error(typeof(T), messageTemplate, propertyValues); + public static void LogError(this ILogger logger, string messageTemplate, params object[] propertyValues) + => logger.LogError(typeof(T), messageTemplate, propertyValues); /// /// Logs a warning message. diff --git a/src/Umbraco.Core/Logging/NullLogger.cs b/src/Umbraco.Core/Logging/NullLogger.cs index 7945e0b965..3b40efe78e 100644 --- a/src/Umbraco.Core/Logging/NullLogger.cs +++ b/src/Umbraco.Core/Logging/NullLogger.cs @@ -31,27 +31,27 @@ namespace Umbraco.Core.Logging } - public void Error(Type reporting, Exception exception, string message) + public void LogError(Type reporting, Exception exception, string message) { } - public void Error(Type reporting, Exception exception) + public void LogError(Type reporting, Exception exception) { } - public void Error(Type reporting, string message) + public void LogError(Type reporting, string message) { } - public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) { } - public void Error(Type reporting, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) { } diff --git a/src/Umbraco.Core/Logging/ProfilingLogger.cs b/src/Umbraco.Core/Logging/ProfilingLogger.cs index d642926147..3d323fe0dd 100644 --- a/src/Umbraco.Core/Logging/ProfilingLogger.cs +++ b/src/Umbraco.Core/Logging/ProfilingLogger.cs @@ -82,20 +82,20 @@ namespace Umbraco.Core.Logging public void Fatal(Type reporting, string messageTemplate, params object[] propertyValues) => Logger.Fatal(reporting, messageTemplate, propertyValues); - public void Error(Type reporting, Exception exception, string message) - => Logger.Error(reporting, exception, message); + public void LogError(Type reporting, Exception exception, string message) + => Logger.LogError(reporting, exception, message); - public void Error(Type reporting, Exception exception) - => Logger.Error(reporting, exception); + public void LogError(Type reporting, Exception exception) + => Logger.LogError(reporting, exception); - public void Error(Type reporting, string message) - => Logger.Error(reporting, message); + public void LogError(Type reporting, string message) + => Logger.LogError(reporting, message); - public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) - => Logger.Error(reporting, exception, messageTemplate, propertyValues); + public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + => Logger.LogError(reporting, exception, messageTemplate, propertyValues); - public void Error(Type reporting, string messageTemplate, params object[] propertyValues) - => Logger.Error(reporting, messageTemplate, propertyValues); + public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) + => Logger.LogError(reporting, messageTemplate, propertyValues); public void Warn(Type reporting, string message) => Logger.Warn(reporting, message); diff --git a/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs b/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs index a46a0b0d86..2f97a76b3c 100644 --- a/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs +++ b/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs @@ -38,7 +38,7 @@ namespace Umbraco.Web.Models.Mapping var editor = _propertyEditors[property.PropertyType.PropertyEditorAlias]; if (editor == null) { - _logger.Error>( + _logger.LogError>( new NullReferenceException("The property editor with alias " + property.PropertyType.PropertyEditorAlias + " does not exist"), "No property editor '{PropertyEditorAlias}' found, converting to a Label", property.PropertyType.PropertyEditorAlias); diff --git a/src/Umbraco.Core/Packaging/PackageActionRunner.cs b/src/Umbraco.Core/Packaging/PackageActionRunner.cs index 42a1a7042d..6054f6067d 100644 --- a/src/Umbraco.Core/Packaging/PackageActionRunner.cs +++ b/src/Umbraco.Core/Packaging/PackageActionRunner.cs @@ -34,7 +34,7 @@ namespace Umbraco.Core.Packaging catch (Exception ex) { e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.Error(ex, "Error loading package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); + _logger.LogError(ex, "Error loading package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); } } @@ -56,7 +56,7 @@ namespace Umbraco.Core.Packaging catch (Exception ex) { e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.Error(ex, "Error undoing package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); + _logger.LogError(ex, "Error undoing package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); } } errors = e; diff --git a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs index 352209b987..18658c8194 100644 --- a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs +++ b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs @@ -123,7 +123,7 @@ namespace Umbraco.Web.Routing } catch (Exception ex) { - logger.Error(ex, "GetUrl exception."); + logger.LogError(ex, "GetUrl exception."); url = "#ex"; } diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs index 81db1b700d..9a20e65422 100644 --- a/src/Umbraco.Core/Runtime/MainDom.cs +++ b/src/Umbraco.Core/Runtime/MainDom.cs @@ -121,7 +121,7 @@ namespace Umbraco.Core.Runtime } catch (Exception e) { - _logger.Error(e, "Error while running callback"); + _logger.LogError(e, "Error while running callback"); continue; } } diff --git a/src/Umbraco.Core/Scheduling/KeepAlive.cs b/src/Umbraco.Core/Scheduling/KeepAlive.cs index a47080912c..5953d60822 100644 --- a/src/Umbraco.Core/Scheduling/KeepAlive.cs +++ b/src/Umbraco.Core/Scheduling/KeepAlive.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "Keep alive failed (at '{keepAlivePingUrl}').", keepAlivePingUrl); + _logger.LogError(ex, "Keep alive failed (at '{keepAlivePingUrl}').", keepAlivePingUrl); } } diff --git a/src/Umbraco.Core/Scheduling/TempFileCleanup.cs b/src/Umbraco.Core/Scheduling/TempFileCleanup.cs index 6ac1ff61fe..5651efea10 100644 --- a/src/Umbraco.Core/Scheduling/TempFileCleanup.cs +++ b/src/Umbraco.Core/Scheduling/TempFileCleanup.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "Could not delete temp file {FileName}", file.FullName); + _logger.LogError(ex, "Could not delete temp file {FileName}", file.FullName); } } } diff --git a/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs b/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs index 696c6a58a5..b904ce1f36 100644 --- a/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs +++ b/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs @@ -118,7 +118,7 @@ namespace Umbraco.Examine /// protected override void OnIndexingError(IndexingErrorEventArgs ex) { - ProfilingLogger.Error(GetType(), ex.InnerException, ex.Message); + ProfilingLogger.LogError(GetType(), ex.InnerException, ex.Message); base.OnIndexingError(ex); } diff --git a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs index c8bc02f604..200e3a578c 100644 --- a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs +++ b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs @@ -225,7 +225,7 @@ namespace Umbraco.Web.Compose } catch (Exception e) { - _logger.Error(e, "Failed (will repeat)."); + _logger.LogError(e, "Failed (will repeat)."); } return true; // repeat } @@ -268,7 +268,7 @@ namespace Umbraco.Web.Compose } catch (Exception ex) { - _logger.Error(ex, "Failed to update server record in database."); + _logger.LogError(ex, "Failed to update server record in database."); return false; // probably stop if we have an error } } diff --git a/src/Umbraco.Infrastructure/Examine/IndexRebuilder.cs b/src/Umbraco.Infrastructure/Examine/IndexRebuilder.cs index d9bef752a9..7cf0106903 100644 --- a/src/Umbraco.Infrastructure/Examine/IndexRebuilder.cs +++ b/src/Umbraco.Infrastructure/Examine/IndexRebuilder.cs @@ -65,7 +65,7 @@ namespace Umbraco.Examine } catch (Exception e) { - _logger.Error(e, "Index populating failed for populator {Populator}", populator.GetType()); + _logger.LogError(e, "Index populating failed for populator {Populator}", populator.GetType()); } } } diff --git a/src/Umbraco.Infrastructure/Examine/MediaValueSetBuilder.cs b/src/Umbraco.Infrastructure/Examine/MediaValueSetBuilder.cs index e9aa87a25c..5103a7dd64 100644 --- a/src/Umbraco.Infrastructure/Examine/MediaValueSetBuilder.cs +++ b/src/Umbraco.Infrastructure/Examine/MediaValueSetBuilder.cs @@ -55,7 +55,7 @@ namespace Umbraco.Examine } catch (Exception ex) { - _logger.Error(ex, $"Could not Deserialize ImageCropperValue for item with key {m.Key} "); + _logger.LogError(ex, $"Could not Deserialize ImageCropperValue for item with key {m.Key} "); } if (cropper != null) diff --git a/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs b/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs index 8f3c05f5bd..b38e965ea8 100644 --- a/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs +++ b/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.HealthCheck } catch (Exception ex) { - Logger.Error(ex, "Error running scheduled health check: {HealthCheckName}", t.Name); + Logger.LogError(ex, "Error running scheduled health check: {HealthCheckName}", t.Name); var message = $"Health check failed with exception: {ex.Message}. See logs for details."; return new List { diff --git a/src/Umbraco.Infrastructure/Install/InstallHelper.cs b/src/Umbraco.Infrastructure/Install/InstallHelper.cs index 1333363355..aaba1b458b 100644 --- a/src/Umbraco.Infrastructure/Install/InstallHelper.cs +++ b/src/Umbraco.Infrastructure/Install/InstallHelper.cs @@ -103,7 +103,7 @@ namespace Umbraco.Web.Install } catch (Exception ex) { - _logger.Error(ex, "An error occurred in InstallStatus trying to check upgrades"); + _logger.LogError(ex, "An error occurred in InstallStatus trying to check upgrades"); } } @@ -154,7 +154,7 @@ namespace Umbraco.Web.Install } catch (AggregateException ex) { - _logger.Error(ex, "Could not download list of available starter kits"); + _logger.LogError(ex, "Could not download list of available starter kits"); } return packages; diff --git a/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs b/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs index 0c88c7a096..68a23bf6b2 100644 --- a/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs +++ b/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs @@ -119,7 +119,7 @@ namespace Umbraco.Web.Install.InstallSteps } catch (Exception ex) { - _logger.Error(ex, "An error occurred, reconfiguring..."); + _logger.LogError(ex, "An error occurred, reconfiguring..."); //something went wrong, could not connect so probably need to reconfigure return true; } diff --git a/src/Umbraco.Infrastructure/Logging/Serilog/SerilogLogger.cs b/src/Umbraco.Infrastructure/Logging/Serilog/SerilogLogger.cs index 38af9554ab..ce27a9e1b2 100644 --- a/src/Umbraco.Infrastructure/Logging/Serilog/SerilogLogger.cs +++ b/src/Umbraco.Infrastructure/Logging/Serilog/SerilogLogger.cs @@ -115,14 +115,14 @@ namespace Umbraco.Core.Logging.Serilog } /// - public void Error(Type reporting, Exception exception, string message) + public void LogError(Type reporting, Exception exception, string message) { var logger = LoggerFor(reporting); logger.Error(exception, message); } /// - public void Error(Type reporting, Exception exception) + public void LogError(Type reporting, Exception exception) { var logger = LoggerFor(reporting); var message = "Exception"; @@ -130,19 +130,19 @@ namespace Umbraco.Core.Logging.Serilog } /// - public void Error(Type reporting, string message) + public void LogError(Type reporting, string message) { LoggerFor(reporting).Error(message); } /// - public void Error(Type reporting, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) { LoggerFor(reporting).Error(messageTemplate, propertyValues); } /// - public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) { var logger = LoggerFor(reporting); logger.Error(exception, messageTemplate, propertyValues); diff --git a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogJsonLogViewer.cs b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogJsonLogViewer.cs index 5bf079c1b4..bde6d8e919 100644 --- a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogJsonLogViewer.cs +++ b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogJsonLogViewer.cs @@ -128,7 +128,7 @@ namespace Umbraco.Core.Logging.Viewer { // As we are reading/streaming one line at a time in the JSON file // Thus we can not report the line number, as it will always be 1 - _logger.Error(ex, "Unable to parse a line in the JSON log file"); + _logger.LogError(ex, "Unable to parse a line in the JSON log file"); evt = null; return true; diff --git a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs b/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs index c6ffb9b6ef..05d6ab73fc 100644 --- a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs +++ b/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs @@ -115,7 +115,7 @@ namespace Umbraco.Core.Manifest } catch (Exception e) { - _logger.Error(e, "Failed to parse manifest at '{Path}', ignoring.", path); + _logger.LogError(e, "Failed to parse manifest at '{Path}', ignoring.", path); } } diff --git a/src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs b/src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs index 05d4744526..c675fa4079 100644 --- a/src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs +++ b/src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs @@ -74,7 +74,7 @@ namespace Umbraco.Web.Media } catch (Exception ex) { - _logger.Error(typeof(UploadAutoFillProperties), ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath); + _logger.LogError(typeof(UploadAutoFillProperties), ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath); ResetProperties(content, autoFillConfig, culture, segment); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs index 98d50d61b1..b5ff8f1c19 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs @@ -449,7 +449,7 @@ namespace Umbraco.Core.Migrations.Install private Result HandleInstallException(Exception ex) { - _logger.Error(ex, "Database configuration failed"); + _logger.LogError(ex, "Database configuration failed"); if (_databaseSchemaValidationResult != null) { diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs index 921ba0b3d5..d133819ec9 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs @@ -111,7 +111,7 @@ namespace Umbraco.Core.Migrations.Install { //swallow this for now, not sure how best to handle this with diff databases... though this is internal // and only used for unit tests. If this fails its because the table doesn't exist... generally! - _logger.Error(ex, "Could not drop table {TableName}", tableName); + _logger.LogError(ex, "Could not drop table {TableName}", tableName); } } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs index 243446c5df..6e88ab4db2 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.LogError( ex, "Invalid configuration: \"{Configuration}\", cannot convert editor.", dataType.Configuration); diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs index 4ab5d386b0..4efb685cf9 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs @@ -40,7 +40,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.LogError( ex, "Invalid property editor configuration detected: \"{Configuration}\", cannot convert editor, values will be cleared", dataType.Configuration); diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs index cdd330f190..35e5f71ffe 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs @@ -55,7 +55,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.LogError( ex, "Invalid configuration: \"{Configuration}\", cannot convert editor.", dataType.Configuration); diff --git a/src/Umbraco.Infrastructure/Models/Mapping/PropertyTypeGroupMapper.cs b/src/Umbraco.Infrastructure/Models/Mapping/PropertyTypeGroupMapper.cs index 32ea6fce3f..99708d3fad 100644 --- a/src/Umbraco.Infrastructure/Models/Mapping/PropertyTypeGroupMapper.cs +++ b/src/Umbraco.Infrastructure/Models/Mapping/PropertyTypeGroupMapper.cs @@ -210,7 +210,7 @@ namespace Umbraco.Web.Models.Mapping //fixme: Don't explode if we can't find this, log an error and change this to a label if (propertyEditor == null) { - _logger.Error(GetType(), + _logger.LogError(GetType(), "No property editor could be resolved with the alias: {PropertyEditorAlias}, defaulting to label", p.PropertyEditorAlias); propertyEditorAlias = Constants.PropertyEditors.Aliases.Label; propertyEditor = _propertyEditors[propertyEditorAlias]; diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index 6b1aa96e69..b2d3c4dc73 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -539,7 +539,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _contentTypeService.CreateContainer(-1, rootFolder); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); + _logger.LogError(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); throw tryCreateFolder.Exception; } var rootFolderId = tryCreateFolder.Result.Entity.Id; @@ -573,7 +573,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _contentTypeService.CreateContainer(current.Id, folderName); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); + _logger.LogError(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); throw tryCreateFolder.Exception; } return _contentTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); @@ -952,7 +952,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _dataTypeService.CreateContainer(-1, rootFolder); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); + _logger.LogError(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); throw tryCreateFolder.Exception; } current = _dataTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); @@ -985,7 +985,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _dataTypeService.CreateContainer(current.Id, folderName); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); + _logger.LogError(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); throw tryCreateFolder.Exception; } return _dataTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs index af0f58eb0e..94d7b8c076 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs @@ -226,7 +226,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement if (string.IsNullOrWhiteSpace(entity.Alias)) { var ex = new Exception($"ContentType '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error("ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name); + Logger.LogError("ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name); throw ex; } diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index 5bfbd86486..96e98ae9c4 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -1216,7 +1216,7 @@ AND umbracoNode.id <> @id", { var ex = new InvalidOperationException($"Property Type '{pt.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error>("Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", + Logger.LogError>("Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", pt.Name); throw ex; @@ -1229,7 +1229,7 @@ AND umbracoNode.id <> @id", { var ex = new InvalidOperationException($"{typeof(TEntity).Name} '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error>("{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", + Logger.LogError>("{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", typeof(TEntity).Name, entity.Name); diff --git a/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs b/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs index ec4cfca498..375ddac767 100644 --- a/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs +++ b/src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs @@ -161,7 +161,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax } catch (Exception e) { - logger.Error(e, "Failed to detected SqlServer version."); + logger.LogError(e, "Failed to detected SqlServer version."); version = new ServerVersionInfo(); // all unknown } } diff --git a/src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs b/src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs index a4b4afbe25..deeaa4bc5f 100644 --- a/src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs +++ b/src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs @@ -226,7 +226,7 @@ namespace Umbraco.Core.Persistence protected override void OnException(Exception ex) { - _logger.Error(ex, "Exception ({InstanceId}).", InstanceId); + _logger.LogError(ex, "Exception ({InstanceId}).", InstanceId); _logger.Debug("At:\r\n{StackTrace}", Environment.StackTrace); if (EnableSqlTrace == false) _logger.Debug("Sql:\r\n{Sql}", CommandToString(LastSQL, LastArgs)); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs index 586a120609..2a00d2f788 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs @@ -103,7 +103,7 @@ namespace Umbraco.Web.PropertyEditors catch (Exception ex) { if (writeLog) - Logger.Error(ex, "Could not parse image cropper value '{Json}'", value); + Logger.LogError(ex, "Could not parse image cropper value '{Json}'", value); return null; } } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs index 63814c05c7..67feea6cac 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs @@ -122,7 +122,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error("Error getting links", ex); + _logger.LogError("Error getting links", ex); } return base.ToEditor(property, culture, segment); @@ -157,7 +157,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error("Error saving links", ex); + _logger.LogError("Error saving links", ex); } return base.FromEditor(editorValue, currentValue); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs index 58a280e5db..81b3ba7a63 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs @@ -144,7 +144,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error(typeof(HtmlImageSourceParser), ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath); + _logger.LogError(typeof(HtmlImageSourceParser), ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath); } } } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs index 3a35bdfc9a..ae34e4fe51 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs @@ -92,7 +92,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); + Current.Logger.LogError(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); } } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs index 0043eeed72..95352bffcf 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs @@ -44,7 +44,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters catch (Exception ex) { // cannot deserialize, assume it may be a raw image url - Current.Logger.Error(ex, "Could not deserialize string '{JsonString}' into an image cropper value.", sourceString); + Current.Logger.LogError(ex, "Could not deserialize string '{JsonString}' into an image cropper value.", sourceString); value = new ImageCropperValue { Src = sourceString }; } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs index 3e6abdac64..6354b6c1a7 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs @@ -58,7 +58,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); + Current.Logger.LogError(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); } } diff --git a/src/Umbraco.Infrastructure/Routing/NotFoundHandlerHelper.cs b/src/Umbraco.Infrastructure/Routing/NotFoundHandlerHelper.cs index 335e1f868a..d5b783e324 100644 --- a/src/Umbraco.Infrastructure/Routing/NotFoundHandlerHelper.cs +++ b/src/Umbraco.Infrastructure/Routing/NotFoundHandlerHelper.cs @@ -107,7 +107,7 @@ namespace Umbraco.Web.Routing } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse xpath expression: {ContentXPath}", errorPage.ContentXPath); + Current.Logger.LogError(ex, "Could not parse xpath expression: {ContentXPath}", errorPage.ContentXPath); return null; } } diff --git a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs index 2a925f9de9..08f0d8d378 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs @@ -270,7 +270,7 @@ namespace Umbraco.Core.Runtime var msg = "Unhandled exception in AppDomain"; if (isTerminating) msg += " (terminating)"; msg += "."; - Logger.Error(exception, msg); + Logger.LogError(exception, msg); }; } diff --git a/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs b/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs index 419a1781a2..08e038a501 100644 --- a/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs +++ b/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs @@ -52,7 +52,7 @@ namespace Umbraco.Core.Runtime } catch (TimeoutException ex) { - _logger.Error(ex); + _logger.LogError(ex); return Task.FromResult(false); } finally diff --git a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs index d3bb7eefac..bdb013f83b 100644 --- a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs +++ b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core.Runtime { if (IsLockTimeoutException(ex)) { - _logger.Error(ex, "Sql timeout occurred, could not acquire MainDom."); + _logger.LogError(ex, "Sql timeout occurred, could not acquire MainDom."); _errorDuringAcquiring = true; return false; } @@ -103,7 +103,7 @@ namespace Umbraco.Core.Runtime catch (Exception ex) { // unexpected - _logger.Error(ex, "Unexpected error, cannot acquire MainDom"); + _logger.LogError(ex, "Unexpected error, cannot acquire MainDom"); _errorDuringAcquiring = true; return false; } @@ -186,7 +186,7 @@ namespace Umbraco.Core.Runtime } catch (Exception ex) { - _logger.Error(ex, "Unexpected error during listening."); + _logger.LogError(ex, "Unexpected error during listening."); // We need to keep on listening unless we've been notified by our own AppDomain to shutdown since // we don't want to shutdown resources controlled by MainDom inadvertently. We'll just keep listening otherwise. @@ -277,12 +277,12 @@ namespace Umbraco.Core.Runtime { if (IsLockTimeoutException(ex as SqlException)) { - _logger.Error(ex, "Sql timeout occurred, waiting for existing MainDom is canceled."); + _logger.LogError(ex, "Sql timeout occurred, waiting for existing MainDom is canceled."); _errorDuringAcquiring = true; return false; } // unexpected - _logger.Error(ex, "Unexpected error, waiting for existing MainDom is canceled."); + _logger.LogError(ex, "Unexpected error, waiting for existing MainDom is canceled."); _errorDuringAcquiring = true; return false; } @@ -321,11 +321,11 @@ namespace Umbraco.Core.Runtime if (IsLockTimeoutException(ex as SqlException)) { // something is wrong, we cannot acquire, not much we can do - _logger.Error(ex, "Sql timeout occurred, could not forcibly acquire MainDom."); + _logger.LogError(ex, "Sql timeout occurred, could not forcibly acquire MainDom."); _errorDuringAcquiring = true; return false; } - _logger.Error(ex, "Unexpected error, could not forcibly acquire MainDom."); + _logger.LogError(ex, "Unexpected error, could not forcibly acquire MainDom."); _errorDuringAcquiring = true; return false; } @@ -409,7 +409,7 @@ namespace Umbraco.Core.Runtime } catch (Exception ex) { - _logger.Error(ex, "Unexpected error during dipsose."); + _logger.LogError(ex, "Unexpected error during dipsose."); } finally { diff --git a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs index a9fff229f2..9aac31a562 100644 --- a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs +++ b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs @@ -414,7 +414,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} Task runner exception", _logPrefix); + _logger.LogError(ex, "{LogPrefix} Task runner exception", _logPrefix); } } } @@ -573,7 +573,7 @@ namespace Umbraco.Web.Scheduling catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} Task has failed", _logPrefix); + _logger.LogError(ex, "{LogPrefix} Task has failed", _logPrefix); } } @@ -617,7 +617,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); + _logger.LogError(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); } } diff --git a/src/Umbraco.Infrastructure/Scheduling/LogScrubber.cs b/src/Umbraco.Infrastructure/Scheduling/LogScrubber.cs index b3e30a7353..22df19cb2a 100644 --- a/src/Umbraco.Infrastructure/Scheduling/LogScrubber.cs +++ b/src/Umbraco.Infrastructure/Scheduling/LogScrubber.cs @@ -41,7 +41,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "Unable to locate a log scrubbing maximum age. Defaulting to 24 hours."); + _logger.LogError(ex, "Unable to locate a log scrubbing maximum age. Defaulting to 24 hours."); } return maximumAge; diff --git a/src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs b/src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs index 6ec0250d90..e5c35a32aa 100644 --- a/src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs +++ b/src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs @@ -98,7 +98,7 @@ namespace Umbraco.Web.Scheduling catch (Exception ex) { // important to catch *everything* to ensure the task repeats - _logger.Error(ex, "Failed."); + _logger.LogError(ex, "Failed."); } return true; // repeat diff --git a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs index d18480eb82..101535a23e 100644 --- a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs +++ b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs @@ -95,7 +95,7 @@ namespace Umbraco.Web.Search } catch (Exception ex) { - _logger.Error(ex, "Failed to rebuild empty indexes."); + _logger.LogError(ex, "Failed to rebuild empty indexes."); } } diff --git a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs index 4cd85bc408..1c939d4e18 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs @@ -1417,7 +1417,7 @@ namespace Umbraco.Core.Services.Implement var result = CommitDocumentChangesInternal(scope, d, saveEventArgs, allLangs.Value, d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.LogError(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -1427,7 +1427,7 @@ namespace Umbraco.Core.Services.Implement d.ContentSchedule.Clear(ContentScheduleAction.Expire, date); var result = Unpublish(d, userId: d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to unpublish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.LogError(null, "Failed to unpublish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } } @@ -1498,7 +1498,7 @@ namespace Umbraco.Core.Services.Implement result = CommitDocumentChangesInternal(scope, d, saveEventArgs, allLangs.Value, d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.LogError(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -1512,7 +1512,7 @@ namespace Umbraco.Core.Services.Implement : SaveAndPublish(d, userId: d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.LogError(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -3164,7 +3164,7 @@ namespace Umbraco.Core.Services.Implement if (rollbackSaveResult.Success == false) { //Log the error/warning - Logger.Error("User '{UserId}' was unable to rollback content '{ContentId}' to version '{VersionId}'", userId, id, versionId); + Logger.LogError("User '{UserId}' was unable to rollback content '{ContentId}' to version '{VersionId}'", userId, id, versionId); } else { diff --git a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs index 77bc82f092..2c368871e5 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs @@ -206,7 +206,7 @@ namespace Umbraco.Core.Services.Implement } catch (Exception ex) { - _logger.Error(ex, "Could not load file into XML {File}", supplementaryFile.File.FullName); + _logger.LogError(ex, "Could not load file into XML {File}", supplementaryFile.File.FullName); continue; } diff --git a/src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs b/src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs index cf53fb34cd..bac7cf7d8f 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs @@ -523,7 +523,7 @@ namespace Umbraco.Core.Services.Implement } catch (Exception ex) { - _logger.Error(ex, "An error occurred sending notification"); + _logger.LogError(ex, "An error occurred sending notification"); } finally { diff --git a/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs index 2f6bb61e42..6b62002c71 100644 --- a/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs @@ -361,7 +361,7 @@ namespace Umbraco.Core.Sync } catch (JsonException ex) { - Logger.Error(ex, "Failed to deserialize instructions ({DtoId}: '{DtoInstructions}').", + Logger.LogError(ex, "Failed to deserialize instructions ({DtoId}: '{DtoInstructions}').", dto.Id, dto.Instructions); @@ -419,7 +419,7 @@ namespace Umbraco.Core.Sync //} catch (Exception ex) { - Logger.Error( + Logger.LogError( ex, "DISTRIBUTED CACHE IS NOT UPDATED. Failed to execute instructions ({DtoId}: '{DtoInstructions}'). Instruction is being skipped/ignored", dto.Id, diff --git a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs index 596a744b27..5fd48ad40b 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs @@ -97,7 +97,7 @@ namespace Umbraco.ModelsBuilder.Embedded catch (Exception e) { _mbErrors.Report("Failed to build Live models.", e); - _logger.Error("Failed to generate models.", e); + _logger.LogError("Failed to generate models.", e); } finally { diff --git a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs index 6248267da1..5f04541dcb 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs @@ -305,7 +305,7 @@ namespace Umbraco.ModelsBuilder.Embedded { try { - _logger.Error("Failed to build models.", e); + _logger.LogError("Failed to build models.", e); _logger.Warn("Running without models."); // be explicit _errors.Report("Failed to build PureLive models.", e); } diff --git a/src/Umbraco.PublishedCache.NuCache/ContentStore.cs b/src/Umbraco.PublishedCache.NuCache/ContentStore.cs index 48bb2c4069..419011ad3d 100644 --- a/src/Umbraco.PublishedCache.NuCache/ContentStore.cs +++ b/src/Umbraco.PublishedCache.NuCache/ContentStore.cs @@ -253,7 +253,7 @@ namespace Umbraco.Web.PublishedCache.NuCache catch (Exception ex) { /* TBD: May already be throwing so don't throw again */ - _logger.Error(ex, "Error trying to release DB"); + _logger.LogError(ex, "Error trying to release DB"); } finally { @@ -264,7 +264,7 @@ namespace Umbraco.Web.PublishedCache.NuCache } catch (Exception ex) { - _logger.Error(ex, "Error trying to lock"); + _logger.LogError(ex, "Error trying to lock"); throw; } finally diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs index c058c9ac48..5ccc070798 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs @@ -41,7 +41,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } catch (Exception ex) { - Current.Logger.Error(ex, "Could not load preview set {PreviewSet} for user {UserId}.", _previewSet, _userId); + Current.Logger.LogError(ex, "Could not load preview set {PreviewSet} for user {UserId}.", _previewSet, _userId); ClearPreviewSet(); @@ -147,7 +147,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } catch (Exception ex) { - Current.Logger.Error(ex, "Couldn't delete preview set {FileName} for user {UserId}", file.Name, userId); + Current.Logger.LogError(ex, "Couldn't delete preview set {FileName} for user {UserId}", file.Name, userId); } } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs index 8221a391b0..ed84a78304 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs @@ -134,13 +134,13 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache //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(ex, "Could not load data from Examine index for media"); + Current.Logger.LogError(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(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state"); + Current.Logger.LogError(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state"); } else throw; } @@ -302,13 +302,13 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache //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(ex, "Could not load data from Examine index for media"); + Current.Logger.LogError(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(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state"); + Current.Logger.LogError(ex, "Could not load data from Examine index for media, the app domain is most likely in a shutdown state"); } else throw; } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs index dadf8b6824..1385975d9c 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs @@ -415,7 +415,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } catch (Exception ex) { - Current.Logger.Error(ex, "Failed to build a DTD for the Xml cache."); + Current.Logger.LogError(ex, "Failed to build a DTD for the Xml cache."); } dtd.AppendLine("]>"); @@ -705,7 +705,7 @@ AND (umbracoNode.id=@id)"; // if something goes wrong remove the file DeleteXmlFile(); - Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); + Current.Logger.LogError(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); } } @@ -745,7 +745,7 @@ AND (umbracoNode.id=@id)"; // if something goes wrong remove the file DeleteXmlFile(); - Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); + Current.Logger.LogError(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); } } @@ -802,7 +802,7 @@ AND (umbracoNode.id=@id)"; } catch (Exception ex) { - Current.Logger.Error(ex, "Failed to load Xml from file '{FileName}'.", _xmlFileName); + Current.Logger.LogError(ex, "Failed to load Xml from file '{FileName}'.", _xmlFileName); try { DeleteXmlFile(); diff --git a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs index cfcdacdadf..6616e94339 100644 --- a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs +++ b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs @@ -344,7 +344,7 @@ namespace Umbraco.Tests.TestHelpers } catch (Exception ex) { - Logger.Error(ex, "Could not remove the old database file"); + Logger.LogError(ex, "Could not remove the old database file"); // swallow this exception - that's because a sub class might require further teardown logic onFail?.Invoke(ex); diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs index 7704b198ae..4b5cdc9c7f 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs @@ -1628,7 +1628,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(ex, "Could not update content sort order"); + Logger.LogError(ex, "Could not update content sort order"); throw; } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs index 146f2c32b7..7ea7096a09 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs @@ -632,7 +632,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(ex, "Error cleaning up temporary udt file in App_Data: {File}", filePath); + _logger.LogError(ex, "Error cleaning up temporary udt file in App_Data: {File}", filePath); } return Ok(); diff --git a/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs b/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs index 03bbe132f3..5e4217ed8d 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs @@ -98,7 +98,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (HttpRequestException ex) { - _logger.Error(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); + _logger.LogError(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); //it's still new JObject() - we return it like this to avoid error codes which triggers UI warnings _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); @@ -136,7 +136,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (HttpRequestException ex) { - _logger.Error(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); + _logger.LogError(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); @@ -199,7 +199,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (HttpRequestException ex) { - _logger.Error(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); + _logger.LogError(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); diff --git a/src/Umbraco.Web.BackOffice/Controllers/DictionaryController.cs b/src/Umbraco.Web.BackOffice/Controllers/DictionaryController.cs index e43f124cc8..882abd7440 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/DictionaryController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/DictionaryController.cs @@ -124,7 +124,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(GetType(), ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId); + _logger.LogError(GetType(), ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId); throw HttpResponseException.CreateNotificationValidationErrorResponse("Error creating dictionary item"); } } @@ -257,7 +257,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(GetType(), ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId); + _logger.LogError(GetType(), ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId); throw HttpResponseException.CreateNotificationValidationErrorResponse("Something went wrong saving dictionary"); } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs index a302f7f7cf..f2724dacbb 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs @@ -162,7 +162,7 @@ namespace Umbraco.Web.BackOffice.Controllers { //ensure it's not listening index.IndexOperationComplete -= Indexer_IndexOperationComplete; - _logger.Error(ex, "An error occurred rebuilding index"); + _logger.LogError(ex, "An error occurred rebuilding index"); var response = new ConflictObjectResult("The index could not be rebuilt at this time, most likely there is another thread currently writing to the index. Error: {ex}"); HttpContext.SetReasonPhrase("Could Not Rebuild"); diff --git a/src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs b/src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs index cf951a57c3..f7d00585d1 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs @@ -102,7 +102,7 @@ namespace Umbraco.Web.BackOffice.Controllers catch (Exception exception) { const string errorMessage = "Error creating macro"; - _logger.Error(exception, errorMessage); + _logger.LogError(exception, errorMessage); throw HttpResponseException.CreateNotificationValidationErrorResponse(errorMessage); } } @@ -226,7 +226,7 @@ namespace Umbraco.Web.BackOffice.Controllers catch (Exception exception) { const string errorMessage = "Error creating macro"; - _logger.Error(exception, errorMessage); + _logger.LogError(exception, errorMessage); throw HttpResponseException.CreateNotificationValidationErrorResponse(errorMessage); } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs index ba19f7c2b4..26c98cb45e 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs @@ -629,7 +629,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - Logger.Error(ex, "Could not update media sort order"); + Logger.LogError(ex, "Could not update media sort order"); throw; } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs b/src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs index b61e86746a..b39da8862a 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs @@ -99,7 +99,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(ex, "Failed to uninstall."); + _logger.LogError(ex, "Failed to uninstall."); throw; } diff --git a/src/Umbraco.Web.BackOffice/Controllers/RelationTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/RelationTypeController.cs index 54fc3352d3..b67a2f8b48 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/RelationTypeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/RelationTypeController.cs @@ -154,7 +154,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(GetType(), ex, "Error creating relation type with {Name}", relationType.Name); + _logger.LogError(GetType(), ex, "Error creating relation type with {Name}", relationType.Name); throw HttpResponseException.CreateNotificationValidationErrorResponse("Error creating relation type."); } } @@ -185,7 +185,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(GetType(), ex, "Error saving relation type with {Id}", relationType.Id); + _logger.LogError(GetType(), ex, "Error saving relation type with {Id}", relationType.Id); throw HttpResponseException.CreateNotificationValidationErrorResponse("Something went wrong when saving the relation type"); } } diff --git a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs index 0646f94121..a838dea0eb 100644 --- a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs @@ -75,7 +75,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (Exception ex) { - _logger.Error(ex, + _logger.LogError(ex, "Could not delete temp file {FileName}", f.TempFilePath); } } @@ -129,7 +129,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (Exception ex) { - _logger.Error(ex, + _logger.LogError(ex, "Could not delete temp file {FileName}", f.TempFilePath); } diff --git a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs index acafacff47..941d9153a1 100644 --- a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs @@ -104,7 +104,7 @@ namespace Umbraco.Web.BackOffice.Filters } catch (AntiforgeryValidationException ex) { - _logger.Error(ex, "Could not validate XSRF token"); + _logger.LogError(ex, "Could not validate XSRF token"); return false; } } diff --git a/src/Umbraco.Web.BackOffice/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web.BackOffice/HealthCheck/HealthCheckController.cs index 6b8eada506..013dadcabc 100644 --- a/src/Umbraco.Web.BackOffice/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web.BackOffice/HealthCheck/HealthCheckController.cs @@ -71,7 +71,7 @@ namespace Umbraco.Web.BackOffice.Controllers } catch (Exception ex) { - _logger.Error(ex, "Exception in health check: {HealthCheckName}", check.Name); + _logger.LogError(ex, "Exception in health check: {HealthCheckName}", check.Name); throw; } } diff --git a/src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs b/src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs index 5ce8e09280..95660a721a 100644 --- a/src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs +++ b/src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs @@ -63,7 +63,7 @@ namespace Umbraco.Web.BackOffice.PropertyEditors } catch(Exception ex) { - _logger.Error(ex, "Error embedding url {Url} - width: {Width} height: {Height}", url, width, height); + _logger.LogError(ex, "Error embedding url {Url} - width: {Width} height: {Height}", url, width, height); result.OEmbedStatus = OEmbedStatus.Error; } diff --git a/src/Umbraco.Web.Common/Extensions/ImageCropperTemplateExtensions.cs b/src/Umbraco.Web.Common/Extensions/ImageCropperTemplateExtensions.cs index ddcd8e7abe..2cd90e83db 100644 --- a/src/Umbraco.Web.Common/Extensions/ImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ImageCropperTemplateExtensions.cs @@ -27,7 +27,7 @@ namespace Umbraco.Extensions } catch (Exception ex) { - Current.Logger.Error(typeof(ImageCropperTemplateExtensions), ex, "Could not parse the json string: {Json}", json); + Current.Logger.LogError(typeof(ImageCropperTemplateExtensions), ex, "Could not parse the json string: {Json}", json); } } diff --git a/src/Umbraco.Web.Common/Install/InstallApiController.cs b/src/Umbraco.Web.Common/Install/InstallApiController.cs index edc73ef293..a9d2fecfec 100644 --- a/src/Umbraco.Web.Common/Install/InstallApiController.cs +++ b/src/Umbraco.Web.Common/Install/InstallApiController.cs @@ -155,7 +155,7 @@ namespace Umbraco.Web.Common.Install } catch (Exception ex) { - _logger.Error(ex, "An error occurred during installation step {Step}", + _logger.LogError(ex, "An error occurred during installation step {Step}", step.Name); if (ex is TargetInvocationException && ex.InnerException != null) @@ -268,7 +268,7 @@ namespace Umbraco.Web.Common.Install } catch (Exception ex) { - _logger.Error(ex, "Checking if step requires execution ({Step}) failed.", + _logger.LogError(ex, "Checking if step requires execution ({Step}) failed.", step.Name); throw; } @@ -299,7 +299,7 @@ namespace Umbraco.Web.Common.Install } catch (Exception ex) { - _logger.Error(ex, "Installation step {Step} failed.", step.Name); + _logger.LogError(ex, "Installation step {Step} failed.", step.Name); throw; } } diff --git a/src/Umbraco.Web.Common/Install/InstallAuthorizeAttribute.cs b/src/Umbraco.Web.Common/Install/InstallAuthorizeAttribute.cs index 80a21d6724..dd75aea739 100644 --- a/src/Umbraco.Web.Common/Install/InstallAuthorizeAttribute.cs +++ b/src/Umbraco.Web.Common/Install/InstallAuthorizeAttribute.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Common.Install } catch (Exception ex) { - logger.Error(ex, "An error occurred determining authorization"); + logger.LogError(ex, "An error occurred determining authorization"); return false; } } diff --git a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs index 587a60caa9..67334e941d 100644 --- a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs @@ -65,7 +65,7 @@ namespace Umbraco.Web.Common.Middleware catch (Exception ex) { // try catch so we don't kill everything in all requests - _logger.Error(ex); + _logger.LogError(ex); } finally { @@ -128,7 +128,7 @@ namespace Umbraco.Web.Common.Middleware } catch (Exception ex) { - logger.Error("Could not dispose item with key " + k, ex); + logger.LogError("Could not dispose item with key " + k, ex); } try { @@ -136,7 +136,7 @@ namespace Umbraco.Web.Common.Middleware } catch (Exception ex) { - logger.Error("Could not dispose item key " + k, ex); + logger.LogError("Could not dispose item key " + k, ex); } } } diff --git a/src/Umbraco.Web/CdfLogger.cs b/src/Umbraco.Web/CdfLogger.cs index 83a51a7b38..b8f3ae00db 100644 --- a/src/Umbraco.Web/CdfLogger.cs +++ b/src/Umbraco.Web/CdfLogger.cs @@ -36,12 +36,12 @@ namespace Umbraco.Web public void Error(string msg, Exception ex) { - _logger.Error(ex, msg); + _logger.LogError(ex, msg); } public void Fatal(string msg, Exception ex) { - _logger.Error(ex, msg); + _logger.LogError(ex, msg); } } } diff --git a/src/Umbraco.Web/ImageProcessorLogger.cs b/src/Umbraco.Web/ImageProcessorLogger.cs index d01207b401..8f6be923ef 100644 --- a/src/Umbraco.Web/ImageProcessorLogger.cs +++ b/src/Umbraco.Web/ImageProcessorLogger.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web { // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. var message = $"{callerName} {lineNumber} : {text}"; - Current.Logger.Error(new ImageProcessingException(message)); + Current.Logger.LogError(new ImageProcessingException(message)); } /// @@ -42,7 +42,7 @@ namespace Umbraco.Web { // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. var message = $"{callerName} {lineNumber} : {text}"; - Current.Logger.Error(type, new ImageProcessingException(message)); + Current.Logger.LogError(type, new ImageProcessingException(message)); } } } diff --git a/src/Umbraco.Web/Logging/OwinLogger.cs b/src/Umbraco.Web/Logging/OwinLogger.cs index 7ca3d2a915..96f02a5347 100644 --- a/src/Umbraco.Web/Logging/OwinLogger.cs +++ b/src/Umbraco.Web/Logging/OwinLogger.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.Logging _logger.Fatal(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Error: - _logger.Error(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.LogError(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Warning: _logger.Warn(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); diff --git a/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs index 882cb5624c..eac73fc7da 100644 --- a/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs @@ -119,7 +119,7 @@ namespace Umbraco.Web.Mvc } catch (Exception ex) { - Logger.Error(ex, "Failed to format passed in token value"); + Logger.LogError(ex, "Failed to format passed in token value"); return false; } } diff --git a/src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs b/src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs index 7616282689..48a13f265d 100644 --- a/src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs +++ b/src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs @@ -109,7 +109,7 @@ namespace Umbraco.Web.Security } catch (System.Exception ex) { - Current.Logger.Error(typeof (AuthenticationOptionsExtensions), ex, "Could not read AuthenticationOptions properties"); + Current.Logger.LogError(typeof (AuthenticationOptionsExtensions), ex, "Could not read AuthenticationOptions properties"); } } else diff --git a/src/Umbraco.Web/Security/MembershipProviderBase.cs b/src/Umbraco.Web/Security/MembershipProviderBase.cs index eacb992b0b..e3deda725c 100644 --- a/src/Umbraco.Web/Security/MembershipProviderBase.cs +++ b/src/Umbraco.Web/Security/MembershipProviderBase.cs @@ -257,7 +257,7 @@ namespace Umbraco.Web.Security if ((PasswordFormat == MembershipPasswordFormat.Hashed) && EnablePasswordRetrieval) { var ex = new ProviderException("Provider can not retrieve a hashed password"); - Current.Logger.Error(ex, "Cannot specify a Hashed password format with the enabledPasswordRetrieval option set to true"); + Current.Logger.LogError(ex, "Cannot specify a Hashed password format with the enabledPasswordRetrieval option set to true"); throw ex; } diff --git a/src/Umbraco.Web/UmbracoApplicationBase.cs b/src/Umbraco.Web/UmbracoApplicationBase.cs index 55ef6747a0..b85ba9de67 100644 --- a/src/Umbraco.Web/UmbracoApplicationBase.cs +++ b/src/Umbraco.Web/UmbracoApplicationBase.cs @@ -291,7 +291,7 @@ namespace Umbraco.Web // ignore HTTP errors if (exception.GetType() == typeof(HttpException)) return; - Current.Logger.Error(exception, "An unhandled exception occurred"); + Current.Logger.LogError(exception, "An unhandled exception occurred"); } // called by ASP.NET (auto event wireup) at any phase in the application life cycle @@ -314,7 +314,7 @@ namespace Umbraco.Web } catch (Exception ex) { - Current.Logger.Error(ex, "Error in {Name} handler.", name); + Current.Logger.LogError(ex, "Error in {Name} handler.", name); throw; } } diff --git a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs index a15014d4e5..98e518e7d0 100644 --- a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs +++ b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs @@ -44,7 +44,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (Exception ex) { - Current.Logger.Error(typeof(AngularAntiForgeryHelper), ex, "Could not validate XSRF token"); + Current.Logger.LogError(typeof(AngularAntiForgeryHelper), ex, "Could not validate XSRF token"); return false; } return true; diff --git a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs index 1646c8a426..9ef704bb52 100644 --- a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs @@ -57,7 +57,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (System.Exception ex) { - Current.Logger.Error(ex, "Could not delete temp file {FileName}", f.TempFilePath); + Current.Logger.LogError(ex, "Could not delete temp file {FileName}", f.TempFilePath); } } } @@ -89,7 +89,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (System.Exception ex) { - Current.Logger.Error(ex, "Could not acquire actionExecutedContext.Response.Content"); + Current.Logger.LogError(ex, "Could not acquire actionExecutedContext.Response.Content"); return; } @@ -119,7 +119,7 @@ namespace Umbraco.Web.WebApi.Filters } catch (System.Exception ex) { - Current.Logger.Error(ex, "Could not delete temp file {FileName}", f.TempFilePath); + Current.Logger.LogError(ex, "Could not delete temp file {FileName}", f.TempFilePath); } //clear out the temp path so it's not returned in the response diff --git a/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs b/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs index 323ab2e727..970098e957 100644 --- a/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs +++ b/src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web.WebApi var requestUrl = context.ExceptionContext?.ControllerContext?.Request?.RequestUri?.AbsoluteUri; var controllerType = context.ExceptionContext?.ActionContext?.ControllerContext?.Controller?.GetType(); - _logger.Error(controllerType, context.Exception, "Unhandled controller exception occurred for request '{RequestUrl}'", requestUrl); + _logger.LogError(controllerType, context.Exception, "Unhandled controller exception occurred for request '{RequestUrl}'", requestUrl); } } diff --git a/src/Umbraco.Web/WebAssets/CDF/ClientDependencyConfiguration.cs b/src/Umbraco.Web/WebAssets/CDF/ClientDependencyConfiguration.cs index e4360e0845..59a4f43bec 100644 --- a/src/Umbraco.Web/WebAssets/CDF/ClientDependencyConfiguration.cs +++ b/src/Umbraco.Web/WebAssets/CDF/ClientDependencyConfiguration.cs @@ -91,7 +91,7 @@ namespace Umbraco.Web.WebAssets.CDF } catch (Exception ex) { - _logger.Error(ex, "Couldn't update ClientDependency version number"); + _logger.LogError(ex, "Couldn't update ClientDependency version number"); } return false; @@ -124,7 +124,7 @@ namespace Umbraco.Web.WebAssets.CDF catch (Exception ex) { //invalid path format or something... try/catch to be safe - _logger.Error(ex, "Could not get path from ClientDependency.config"); + _logger.LogError(ex, "Could not get path from ClientDependency.config"); } var success = true; @@ -140,7 +140,7 @@ namespace Umbraco.Web.WebAssets.CDF catch (Exception ex) { // Something could be locking the directory or the was another error, making sure we don't break the upgrade installer - _logger.Error(ex, "Could not clear temp files"); + _logger.LogError(ex, "Could not clear temp files"); success = false; } }