diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs index 882d9073a9..f0e4a2c71f 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.LogError(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 d8b4eb6c99..557383a8de 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.LogError(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.LogError(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 a16c9822c8..a6af47fab5 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.LogError(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 22dfd8c43e..105ddf056c 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.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); + _logger.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - _logger.LogError(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.LogError(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.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); + _logger.LogError(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - _logger.LogError(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.LogError(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/LoggerExtensions.cs b/src/Umbraco.Core/Logging/LoggerExtensions.cs index efc17fd623..0c9eed8671 100644 --- a/src/Umbraco.Core/Logging/LoggerExtensions.cs +++ b/src/Umbraco.Core/Logging/LoggerExtensions.cs @@ -16,46 +16,6 @@ namespace Umbraco.Core.Logging public static bool IsEnabled(this ILogger logger, LogLevel level) => logger.IsEnabled(typeof(T), level); - /// - /// Logs an error message with an exception. - /// - /// The reporting type. - /// The logger. - /// A message. - /// An exception. - public static void LogError(this ILogger logger, Exception exception, string message) - => logger.LogError(exception, message); - - /// - /// Logs an error message with an exception. - /// - /// The reporting type. - /// The logger. - /// An exception. - /// A message template. - /// Property values. - public static void LogError(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) - => logger.LogError(exception, messageTemplate, propertyValues); - - /// - /// Logs an error message. - /// - /// The reporting type. - /// The logger. - /// A message. - public static void LogError(this ILogger logger, string message) - => logger.LogError(message); - - /// - /// Logs an error message. - /// - /// The reporting type. - /// The logger. - /// A message template. - /// Property values. - public static void LogError(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.LogError(messageTemplate, propertyValues); - /// /// Logs a warning message. /// @@ -96,25 +56,6 @@ namespace Umbraco.Core.Logging public static void LogWarning(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) => logger.LogWarning(exception, messageTemplate, propertyValues); - /// - /// Logs an information message. - /// - /// The reporting type. - /// The logger. - /// A message. - public static void LogInformation(this ILogger logger, string message) - => logger.LogInformation(message); - - /// - /// Logs a information message. - /// - /// The reporting type - /// The logger. - /// A message template. - /// Property values. - public static void LogInformation(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.LogInformation(messageTemplate, propertyValues); - /// /// Logs a debugging message. /// @@ -143,26 +84,5 @@ namespace Umbraco.Core.Logging /// Property values. public static void Verbose(this ILogger logger, string messageTemplate, params object[] propertyValues) => logger.LogTrace(messageTemplate, propertyValues); - - /// - /// Logs a fatal message. - /// - /// The reporting type. - /// The logger. - /// An exception. - /// A message. - public static void Fatal(this ILogger logger, Exception exception, string message) - => logger.LogCritical(exception, message); - - /// - /// Logs a fatal message. - /// - /// The reporting type. - /// The logger. - /// An exception. - /// A message template. - /// Property values. - public static void Fatal(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) - => logger.LogCritical(exception, messageTemplate, propertyValues); } } diff --git a/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs b/src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs index 2f97a76b3c..cddd8a1a81 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.LogError>( + _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 6054f6067d..b99e0c0062 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.LogError(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.LogError(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 18658c8194..66cdd61aa6 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.LogError(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 1a81a2fb71..195bc7ff72 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.LogError(e, "Error while running callback"); + _logger.LogError(e, "Error while running callback"); continue; } } diff --git a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs index 200e3a578c..6aba70530d 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.LogError(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.LogError(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/MediaValueSetBuilder.cs b/src/Umbraco.Infrastructure/Examine/MediaValueSetBuilder.cs index 5103a7dd64..55811c8906 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.LogError(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 33cb0f204f..2e055f53ea 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.LogError(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 aaba1b458b..08d4d40b92 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.LogError(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.LogError(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 68a23bf6b2..3b798ec767 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.LogError(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/Viewer/SerilogJsonLogViewer.cs b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogJsonLogViewer.cs index bde6d8e919..a985d98453 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.LogError(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 05d6ab73fc..40c97c16a9 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.LogError(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/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs index 1cc8115664..d7672f78fd 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.LogError(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 a7417eacb6..195d02fac3 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.LogError(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 6e88ab4db2..1110cbaa0e 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.LogError( + 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 4efb685cf9..7c2164f58a 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.LogError( + 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 35e5f71ffe..04b7ad8aef 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.LogError( + Logger.LogError( ex, "Invalid configuration: \"{Configuration}\", cannot convert editor.", dataType.Configuration); diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index 027b74ebdd..94cc5720cf 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.LogError(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.LogError(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.LogError(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.LogError(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 94d7b8c076..2e165b5600 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.LogError("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 b481ee2dc7..a1bca5e6c1 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.LogError>("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.LogError>("{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 375ddac767..0c69fd7ebc 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.LogError(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 deeaa4bc5f..68f85df25a 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.LogError(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 2a00d2f788..f2e231c390 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.LogError(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 67feea6cac..30d1197eb6 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.LogError("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.LogError("Error saving links", ex); + _logger.LogError("Error saving links", ex); } return base.FromEditor(editorValue, currentValue); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs index ae34e4fe51..8addda00dd 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.LogError(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 95352bffcf..2feb676549 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.LogError(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 6354b6c1a7..6ce8a47925 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.LogError(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 d5b783e324..a46b0be150 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.LogError(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 1b94b9239d..3fb07b6841 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs @@ -34,7 +34,7 @@ namespace Umbraco.Core.Runtime private readonly IConnectionStrings _connectionStrings; public CoreRuntime( - Configs configs, + Configs configs, IUmbracoVersion umbracoVersion, IIOHelper ioHelper, ILogger logger, @@ -59,7 +59,7 @@ namespace Umbraco.Core.Runtime _loggerFactory = loggerFactory; _umbracoBootPermissionChecker = umbracoBootPermissionChecker; - + Logger = logger; MainDom = mainDom; TypeFinder = typeFinder; @@ -275,7 +275,7 @@ namespace Umbraco.Core.Runtime var msg = "Unhandled exception in AppDomain"; if (isTerminating) msg += " (terminating)"; msg += "."; - Logger.LogError(exception, msg); + Logger.LogError(exception, msg); }; } diff --git a/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs b/src/Umbraco.Infrastructure/Runtime/MainDomSemaphoreLock.cs index 50c4b91671..37c1244e08 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.LogError(ex.Message); + _logger.LogError(ex.Message); return Task.FromResult(false); } finally diff --git a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs index 20d720ae79..e50b3e9416 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.LogError(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.LogError(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.LogError(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.LogError(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.LogError(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.LogError(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.LogError(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.LogError(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 ae753883fc..4bcc179fc9 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.LogError(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.LogError(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.LogError(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); + _logger.LogError(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); } } diff --git a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs index ca1f9c3bf4..2fcad84241 100644 --- a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs +++ b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs @@ -97,7 +97,7 @@ namespace Umbraco.Web.Search } catch (Exception ex) { - _logger.LogError(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 266a18f931..56bf1ebe94 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.LogError(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.LogError(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.LogError(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.LogError(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.LogError("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 823f5cecad..a069e85410 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.LogError(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 bac7cf7d8f..d17569d308 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.LogError(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 a557244b62..1dc2af526b 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.LogError(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.LogError( + 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 a7bef79cee..75573a2272 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.LogError("Failed to generate models.", e); + _logger.LogError("Failed to generate models.", e); } finally { diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs index 5ccc070798..96f27a7051 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.LogError(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.LogError(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 c0a6dc4f33..ee59b792dc 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.LogError(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.LogError(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.LogError(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.LogError(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 1215f2d489..b15a869821 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.LogError(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.LogError(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.LogError(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.LogError(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 2212ede7cb..e9315a1435 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.LogError(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 c4a56830db..7ef7b75cea 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.LogError(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 dc21196158..53497225b6 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.LogError(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 5e4217ed8d..fca0a4da1a 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.LogError(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.LogError(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.LogError(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/ExamineManagementController.cs b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs index e8646f4d47..f64360efc7 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.LogError(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 f7d00585d1..43a4275591 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.LogError(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.LogError(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 cdac1cdf8f..5bf7bfe30c 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.LogError(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 b39da8862a..5a1114406f 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.LogError(ex, "Failed to uninstall."); + _logger.LogError(ex, "Failed to uninstall."); throw; } diff --git a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs index 9e14a4f5db..c9d7789797 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.LogError(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.LogError(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 941d9153a1..339127953c 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.LogError(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 013dadcabc..586768b899 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.LogError(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 95660a721a..88b92fc2e2 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.LogError(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/Install/InstallAuthorizeAttribute.cs b/src/Umbraco.Web.Common/Install/InstallAuthorizeAttribute.cs index dd75aea739..9b5b19f2fc 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.LogError(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 e38c91b1f5..48360650d7 100644 --- a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs @@ -53,7 +53,7 @@ namespace Umbraco.Web.Common.Middleware try { if (umbracoContextReference.UmbracoContext.IsFrontEndUmbracoRequest) - { + { LogHttpRequest.TryGetCurrentHttpRequestId(out var httpRequestId, _requestCache); _logger.Verbose("Begin request [{HttpRequestId}]: {RequestUrl}", httpRequestId, requestUri); } @@ -65,7 +65,7 @@ namespace Umbraco.Web.Common.Middleware catch (Exception ex) { // try catch so we don't kill everything in all requests - _logger.LogError(ex.Message); + _logger.LogError(ex.Message); } finally { @@ -128,7 +128,7 @@ namespace Umbraco.Web.Common.Middleware } catch (Exception ex) { - logger.LogError("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.LogError("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 07d4eca0ea..a89035e220 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.LogError(ex, msg); + _logger.LogError(ex, msg); } public void Fatal(string msg, Exception ex) { - _logger.LogError(ex, msg); + _logger.LogError(ex, msg); } } } diff --git a/src/Umbraco.Web/ImageProcessorLogger.cs b/src/Umbraco.Web/ImageProcessorLogger.cs index 78c0cd231e..bdbf95ed38 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.LogError(new ImageProcessingException(message).Message); + Current.Logger.LogError(new ImageProcessingException(message).Message); } /// diff --git a/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs index eac73fc7da..24aef4c370 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.LogError(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/MembershipProviderBase.cs b/src/Umbraco.Web/Security/MembershipProviderBase.cs index e3deda725c..7e81008374 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.LogError(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 8d40a36240..ed5c2115d4 100644 --- a/src/Umbraco.Web/UmbracoApplicationBase.cs +++ b/src/Umbraco.Web/UmbracoApplicationBase.cs @@ -294,7 +294,7 @@ namespace Umbraco.Web // ignore HTTP errors if (exception.GetType() == typeof(HttpException)) return; - Current.Logger.LogError(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 @@ -317,7 +317,7 @@ namespace Umbraco.Web } catch (Exception ex) { - Current.Logger.LogError(ex, "Error in {Name} handler.", name); + Current.Logger.LogError(ex, "Error in {Name} handler.", name); throw; } } diff --git a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs index 1180cbd9d6..b441a6228a 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.LogError(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.LogError(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.LogError(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/WebAssets/CDF/ClientDependencyConfiguration.cs b/src/Umbraco.Web/WebAssets/CDF/ClientDependencyConfiguration.cs index 8532c3ae0d..b73cee7524 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.LogError(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.LogError(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.LogError(ex, "Could not clear temp files"); + _logger.LogError(ex, "Could not clear temp files"); success = false; } }