From 488093add39ea8cf8956e80fcee8ea491b43fa62 Mon Sep 17 00:00:00 2001 From: Nikolaj Date: Wed, 16 Sep 2020 09:58:07 +0200 Subject: [PATCH] Remove LogWarning from LoggerExtensions --- .../ContentAppFactoryCollection.cs | 2 +- src/Umbraco.Core/Logging/LoggerExtensions.cs | 50 ------------------- src/Umbraco.Core/Models/Member.cs | 18 +++---- .../Packaging/PackageDefinitionXmlParser.cs | 2 +- .../Packaging/PackagesRepository.cs | 2 +- .../Routing/ContentFinderByUrlAndTemplate.cs | 2 +- src/Umbraco.Core/Runtime/MainDom.cs | 4 +- .../BatchedDatabaseServerMessenger.cs | 2 +- .../Cache/DistributedCacheBinder.cs | 2 +- .../HealthCheck/HealthCheckResults.cs | 2 +- .../Upgrade/V_8_0_0/DataTypeMigration.cs | 6 +-- .../Models/Mapping/DataTypeMapDefinition.cs | 2 +- .../Models/Mapping/MacroMapDefinition.cs | 2 +- .../Packaging/PackageDataInstallation.cs | 8 +-- .../Persistence/DbConnectionExtensions.cs | 2 +- .../Implement/ContentRepositoryBase.cs | 2 +- .../Implement/ContentTypeRepositoryBase.cs | 2 +- .../Implement/LanguageRepository.cs | 2 +- .../BlockEditorPropertyEditor.cs | 4 +- .../PropertyEditors/DataValueEditor.cs | 2 +- .../ImageCropperPropertyValueEditor.cs | 2 +- .../NestedContentPropertyEditor.cs | 4 +- .../Runtime/SqlMainDomLock.cs | 2 +- src/Umbraco.Infrastructure/RuntimeState.cs | 2 +- .../Services/Implement/ContentService.cs | 2 +- .../Implement/LocalizedTextService.cs | 8 +-- .../LocalizedTextServiceFileSources.cs | 4 +- .../Services/Implement/UserService.cs | 2 +- .../Sync/DatabaseServerMessenger.cs | 6 +-- .../LiveModelsProvider.cs | 2 +- .../DataSource/DatabaseDataSource.cs | 4 +- .../DictionaryPublishedContent.cs | 2 +- .../PublishedMediaCache.cs | 4 +- .../LegacyXmlPublishedCache/XmlStore.cs | 4 +- .../XmlStoreFilePersister.cs | 2 +- .../Controllers/AuthenticationController.cs | 4 +- .../Controllers/BackOfficeController.cs | 12 ++--- .../Controllers/ContentController.cs | 4 +- .../Controllers/ContentControllerBase.cs | 2 +- .../Controllers/ContentTypeController.cs | 2 +- .../Controllers/MediaController.cs | 2 +- .../Filters/ContentModelValidator.cs | 2 +- .../FileUploadCleanupFilterAttribute.cs | 12 ++--- .../Security/PasswordChanger.cs | 4 +- .../Trees/ContentTreeControllerBase.cs | 2 +- .../Middleware/UmbracoRequestMiddleware.cs | 4 +- src/Umbraco.Web/CdfLogger.cs | 2 +- .../Editors/BackOfficeController.cs | 4 +- src/Umbraco.Web/Editors/PasswordChanger.cs | 4 +- src/Umbraco.Web/Mvc/RenderMvcController.cs | 2 +- src/Umbraco.Web/Mvc/RenderRouteHandler.cs | 2 +- src/Umbraco.Web/Security/MembershipHelper.cs | 4 +- .../Providers/UmbracoMembershipProvider.cs | 4 +- src/Umbraco.Web/UmbracoInjectedModule.cs | 4 +- src/Umbraco.Web/UmbracoModule.cs | 2 +- .../FileUploadCleanupFilterAttribute.cs | 14 +++--- 56 files changed, 105 insertions(+), 155 deletions(-) diff --git a/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs b/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs index d79485fe7e..b4c20ea519 100644 --- a/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs +++ b/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs @@ -51,7 +51,7 @@ namespace Umbraco.Web.ContentApps // dying is not user-friendly, so let's write to log instead, and wish people read logs... //throw new InvalidOperationException($"Duplicate content app aliases found: {string.Join(",", dups)}"); - _logger.LogWarning("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups)); + _logger.LogWarning("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups)); } return apps; diff --git a/src/Umbraco.Core/Logging/LoggerExtensions.cs b/src/Umbraco.Core/Logging/LoggerExtensions.cs index 0c9eed8671..f40c090c0a 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 a warning message. - /// - /// The reporting type. - /// The logger. - /// A message. - public static void LogWarning(this ILogger logger, string message) - => logger.LogWarning(message); - - /// - /// Logs a warning message. - /// - /// The reporting type. - /// The logger. - /// A message template. - /// Property values. - public static void LogWarning(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.LogWarning(messageTemplate, propertyValues); - - /// - /// Logs a warning message with an exception. - /// - /// The reporting type. - /// The logger. - /// An exception. - /// A message. - public static void LogWarning(this ILogger logger, Exception exception, string message) - => logger.LogWarning(exception, message); - - /// - /// Logs a warning message with an exception. - /// - /// The reporting type. - /// The logger. - /// An exception. - /// A message template. - /// Property values. - public static void LogWarning(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) - => logger.LogWarning(exception, messageTemplate, propertyValues); - /// /// Logs a debugging message. /// @@ -74,15 +34,5 @@ namespace Umbraco.Core.Logging /// Property values. public static void Debug(this ILogger logger, string messageTemplate, params object[] propertyValues) => logger.LogDebug(messageTemplate, propertyValues); - - /// - /// Logs a verbose message. - /// - /// The reporting type. - /// The logger. - /// A message template. - /// Property values. - public static void Verbose(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.LogTrace(messageTemplate, propertyValues); } } diff --git a/src/Umbraco.Core/Models/Member.cs b/src/Umbraco.Core/Models/Member.cs index 52a887bbfb..d22636dd68 100644 --- a/src/Umbraco.Core/Models/Member.cs +++ b/src/Umbraco.Core/Models/Member.cs @@ -414,7 +414,7 @@ namespace Umbraco.Core.Models public virtual string ContentTypeAlias => ContentType.Alias; /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -423,7 +423,7 @@ namespace Umbraco.Core.Models [EditorBrowsable(EditorBrowsableState.Never)] public string LongStringPropertyValue { get; set; } /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -432,7 +432,7 @@ namespace Umbraco.Core.Models [EditorBrowsable(EditorBrowsableState.Never)] public string ShortStringPropertyValue { get; set; } /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -441,7 +441,7 @@ namespace Umbraco.Core.Models [EditorBrowsable(EditorBrowsableState.Never)] public int IntegerPropertyValue { get; set; } /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -450,7 +450,7 @@ namespace Umbraco.Core.Models [EditorBrowsable(EditorBrowsableState.Never)] public bool BoolPropertyValue { get; set; } /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -459,7 +459,7 @@ namespace Umbraco.Core.Models [EditorBrowsable(EditorBrowsableState.Never)] public DateTime DateTimePropertyValue { get; set; } /// - /// Internal/Experimental - only used for mapping queries. + /// Internal/Experimental - only used for mapping queries. /// /// /// Adding these to have first level properties instead of the Properties collection. @@ -472,7 +472,7 @@ namespace Umbraco.Core.Models { void DoLog(string logPropertyAlias, string logPropertyName) { - Current.Logger.LogWarning("Trying to access the '{PropertyName}' property on '{MemberType}' " + + Current.Logger.LogWarning("Trying to access the '{PropertyName}' property on '{MemberType}' " + "but the {PropertyAlias} property does not exist on the member type so a default value is returned. " + "Ensure that you have a property type with alias: {PropertyAlias} configured on your member type in order to use the '{PropertyName}' property on the model correctly.", logPropertyName, @@ -497,7 +497,7 @@ namespace Umbraco.Core.Models { void DoLog(string logPropertyAlias, string logPropertyName) { - Current.Logger.LogWarning("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " + + Current.Logger.LogWarning("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " + "property type {PropertyAlias} does not exist on the member type, ensure that this property type exists so that setting this property works correctly.", logPropertyName, typeof(Member), @@ -524,6 +524,6 @@ namespace Umbraco.Core.Models /// [IgnoreDataMember] - public bool HasAdditionalData => _additionalData != null; + public bool HasAdditionalData => _additionalData != null; } } diff --git a/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs b/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs index 553346ad70..1d93285c26 100644 --- a/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs +++ b/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Packaging } catch (Exception e) { - _logger.LogWarning(e, "Could not add package actions to the package xml definition, the xml did not parse"); + _logger.LogWarning(e, "Could not add package actions to the package xml definition, the xml did not parse"); } var packageXml = new XElement("package", diff --git a/src/Umbraco.Core/Packaging/PackagesRepository.cs b/src/Umbraco.Core/Packaging/PackagesRepository.cs index 9ab36d0988..cebad06a9a 100644 --- a/src/Umbraco.Core/Packaging/PackagesRepository.cs +++ b/src/Umbraco.Core/Packaging/PackagesRepository.cs @@ -213,7 +213,7 @@ namespace Umbraco.Core.Packaging } catch (Exception e) { - _logger.LogWarning(e, "Could not add package actions to the package, the xml did not parse"); + _logger.LogWarning(e, "Could not add package actions to the package, the xml did not parse"); } } diff --git a/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs b/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs index a756a4a6b5..e908556d78 100644 --- a/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs +++ b/src/Umbraco.Core/Routing/ContentFinderByUrlAndTemplate.cs @@ -78,7 +78,7 @@ namespace Umbraco.Web.Routing // IsAllowedTemplate deals both with DisableAlternativeTemplates and ValidateAlternativeTemplates settings if (!node.IsAllowedTemplate(_contentTypeService, _webRoutingSettings, template.Id)) { - Logger.LogWarning("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id); + Logger.LogWarning("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id); frequest.PublishedContent = null; // clear return false; } diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs index 195bc7ff72..04f97d1a15 100644 --- a/src/Umbraco.Core/Runtime/MainDom.cs +++ b/src/Umbraco.Core/Runtime/MainDom.cs @@ -86,7 +86,7 @@ namespace Umbraco.Core.Runtime if (_signaled) return false; if (_isMainDom == false) { - _logger.LogWarning("Register called when MainDom has not been acquired"); + _logger.LogWarning("Register called when MainDom has not been acquired"); return false; } @@ -177,7 +177,7 @@ namespace Umbraco.Core.Runtime catch (OperationCanceledException ex) { // the waiting task could be canceled if this appdomain is naturally shutting down, we'll just swallow this exception - _logger.LogWarning(ex, ex.Message); + _logger.LogWarning(ex, ex.Message); } _logger.LogInformation("Acquired."); diff --git a/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs b/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs index 7792a5dc67..0170a4aeca 100644 --- a/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs +++ b/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs @@ -53,7 +53,7 @@ namespace Umbraco.Web if (_databaseFactory.CanConnect == false) { - Logger.LogWarning("Cannot connect to the database, distributed calls will not be enabled for this server."); + Logger.LogWarning("Cannot connect to the database, distributed calls will not be enabled for this server."); } else { diff --git a/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder.cs b/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder.cs index ba97415ac0..7fd83c9c1e 100644 --- a/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder.cs +++ b/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Cache { // TODO: should this be fatal (ie, an exception)? var name = e.Sender.GetType().Name + "_" + e.EventName; - _logger.LogWarning("Dropping event {EventName} because no corresponding handler was found.", name); + _logger.LogWarning("Dropping event {EventName} because no corresponding handler was found.", name); continue; } diff --git a/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs b/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs index 2e055f53ea..393a78308b 100644 --- a/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs +++ b/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web.HealthCheck } else { - Logger.LogWarning("Checks for '{HealthCheckName}' completed with errors.", checkName); + Logger.LogWarning("Checks for '{HealthCheckName}' completed with errors.", checkName); } foreach (var checkResult in checkResults) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs index e5d47ca45c..8d0cc23fff 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs @@ -94,7 +94,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 { if (!LegacyAliases.Contains(dataType.EditorAlias)) { - _logger.LogWarning( + _logger.LogWarning( "Skipping validation of configuration for data type {NodeId} : {EditorAlias}." + " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, dataType.EditorAlias); @@ -104,7 +104,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 { if (!LegacyAliases.Contains(newAlias)) { - _logger.LogWarning("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})" + _logger.LogWarning("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})" + " because no property editor with that alias was found." + " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, newAlias, dataType.EditorAlias); @@ -119,7 +119,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception e) { - _logger.LogWarning(e, "Failed to validate configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})." + _logger.LogWarning(e, "Failed to validate configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})." + " Please fix the configuration and ensure it is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, newAlias, dataType.EditorAlias); } diff --git a/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs b/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs index 6e34e62c80..f7719c0b08 100644 --- a/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs +++ b/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs @@ -174,7 +174,7 @@ namespace Umbraco.Web.Models.Mapping else { // weird - just leave the field without a value - but warn - _logger.LogWarning("Could not find a value for configuration field '{ConfigField}'", field.Key); + _logger.LogWarning("Could not find a value for configuration field '{ConfigField}'", field.Key); } } } diff --git a/src/Umbraco.Infrastructure/Models/Mapping/MacroMapDefinition.cs b/src/Umbraco.Infrastructure/Models/Mapping/MacroMapDefinition.cs index 3438f5ecd2..b2df6d8553 100644 --- a/src/Umbraco.Infrastructure/Models/Mapping/MacroMapDefinition.cs +++ b/src/Umbraco.Infrastructure/Models/Mapping/MacroMapDefinition.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Models.Mapping { //we'll just map this to a text box paramEditor = _parameterEditors[Constants.PropertyEditors.Aliases.TextBox]; - _logger.LogWarning("Could not resolve a parameter editor with alias {PropertyEditorAlias}, a textbox will be rendered in it's place", source.EditorAlias); + _logger.LogWarning("Could not resolve a parameter editor with alias {PropertyEditorAlias}, a textbox will be rendered in it's place", source.EditorAlias); } target.View = paramEditor.GetValueEditor().View; diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index 94cc5720cf..20f54dbc39 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -686,7 +686,7 @@ namespace Umbraco.Core.Packaging } else { - _logger.LogWarning("Packager: Error handling allowed templates. Template with alias '{TemplateAlias}' could not be found.", alias); + _logger.LogWarning("Packager: Error handling allowed templates. Template with alias '{TemplateAlias}' could not be found.", alias); } } @@ -702,7 +702,7 @@ namespace Umbraco.Core.Packaging } else { - _logger.LogWarning("Packager: Error handling default template. Default template with alias '{DefaultTemplateAlias}' could not be found.", defaultTemplateElement.Value); + _logger.LogWarning("Packager: Error handling default template. Default template with alias '{DefaultTemplateAlias}' could not be found.", defaultTemplateElement.Value); } } } @@ -774,7 +774,7 @@ namespace Umbraco.Core.Packaging if (dataTypeDefinition == null) { // TODO: We should expose this to the UI during install! - _logger.LogWarning("Packager: Error handling creation of PropertyType '{PropertyType}'. Could not find DataTypeDefintion with unique id '{DataTypeDefinitionId}' nor one referencing the DataType with a property editor alias (or legacy control id) '{PropertyEditorAlias}'. Did the package creator forget to package up custom datatypes? This property will be converted to a label/readonly editor if one exists.", + _logger.LogWarning("Packager: Error handling creation of PropertyType '{PropertyType}'. Could not find DataTypeDefintion with unique id '{DataTypeDefinitionId}' nor one referencing the DataType with a property editor alias (or legacy control id) '{PropertyEditorAlias}'. Did the package creator forget to package up custom datatypes? This property will be converted to a label/readonly editor if one exists.", property.Element("Name").Value, dataTypeDefinitionId, property.Element("Type").Value.Trim()); //convert to a label! @@ -831,7 +831,7 @@ namespace Umbraco.Core.Packaging var allowedChild = importedContentTypes.ContainsKey(alias) ? importedContentTypes[alias] : _contentTypeService.Get(alias); if (allowedChild == null) { - _logger.LogWarning( + _logger.LogWarning( "Packager: Error handling DocumentType structure. DocumentType with alias '{DoctypeAlias}' could not be found and was not added to the structure for '{DoctypeStructureAlias}'.", alias, contentType.Alias); continue; diff --git a/src/Umbraco.Infrastructure/Persistence/DbConnectionExtensions.cs b/src/Umbraco.Infrastructure/Persistence/DbConnectionExtensions.cs index 66f47bba14..a17692269e 100644 --- a/src/Umbraco.Infrastructure/Persistence/DbConnectionExtensions.cs +++ b/src/Umbraco.Infrastructure/Persistence/DbConnectionExtensions.cs @@ -53,7 +53,7 @@ namespace Umbraco.Core.Persistence catch (DbException e) { // Don't swallow this error, the exception is super handy for knowing "why" its not available - Current.Logger.LogWarning(e, "Configured database is reporting as not being available."); + Current.Logger.LogWarning(e, "Configured database is reporting as not being available."); return false; } diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs index 215011171c..fa443808c5 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs @@ -709,7 +709,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement { if (ContentRepositoryBase.ThrowOnWarning) throw new InvalidOperationException($"The query returned multiple property sets for content {temp.Id}, {temp.ContentType.Name}"); - Logger.LogWarning>("The query returned multiple property sets for content {ContentId}, {ContentTypeName}", temp.Id, temp.ContentType.Name); + Logger.LogWarning("The query returned multiple property sets for content {ContentId}, {ContentTypeName}", temp.Id, temp.ContentType.Name); } result[temp.VersionId] = new PropertyCollection(properties); diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index a1bca5e6c1..c25fb30c4c 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -1261,7 +1261,7 @@ AND umbracoNode.id <> @id", } else { - Logger.LogWarning>("Could not assign a data type for the property type {PropertyTypeAlias} since no data type was found with a property editor {PropertyEditorAlias}", propertyType.Alias, propertyType.PropertyEditorAlias); + Logger.LogWarning("Could not assign a data type for the property type {PropertyTypeAlias} since no data type was found with a property editor {PropertyEditorAlias}", propertyType.Alias, propertyType.PropertyEditorAlias); } } } diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepository.cs index be5f8533d2..ce2a04fd9f 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LanguageRepository.cs @@ -317,7 +317,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement if (language != null) return language; // this is an anomaly, the service/repo should ensure it cannot happen - Logger.LogWarning("There is no default language. Fix this anomaly by editing the language table in database and setting one language as the default language."); + Logger.LogWarning("There is no default language. Fix this anomaly by editing the language table in database and setting one language as the default language."); // still, don't kill the site, and return "something" diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyEditor.cs index e1d6123107..b7d4cce21d 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyEditor.cs @@ -156,7 +156,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.PropertyValues.Remove(prop.Key); - _logger.LogWarning( + _logger.LogWarning( "ToEditor removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Key, property.PropertyType.Alias); continue; @@ -405,7 +405,7 @@ namespace Umbraco.Web.PropertyEditors if (!propertyTypes.TryGetValue(prop.Key, out var propType)) { block.RawPropertyValues.Remove(prop.Key); - _logger.LogWarning("The property {PropertyKey} for block {BlockKey} was removed because the property type {PropertyTypeAlias} was not found on {ContentTypeAlias}", + _logger.LogWarning("The property {PropertyKey} for block {BlockKey} was removed because the property type {PropertyTypeAlias} was not found on {ContentTypeAlias}", prop.Key, block.Key, prop.Key, contentType.Alias); } else diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs index 73c73f8452..342e1cab3b 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs @@ -217,7 +217,7 @@ namespace Umbraco.Core.PropertyEditors var result = TryConvertValueToCrlType(editorValue.Value); if (result.Success == false) { - Current.Logger.LogWarning("The value {EditorValue} cannot be converted to the type {StorageTypeValue}", editorValue.Value, ValueTypes.ToStorageType(ValueType)); + Current.Logger.LogWarning("The value {EditorValue} cannot be converted to the type {StorageTypeValue}", editorValue.Value, ValueTypes.ToStorageType(ValueType)); return null; } return result.Result; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs index 929d08c042..e634d2630d 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -82,7 +82,7 @@ namespace Umbraco.Web.PropertyEditors catch (Exception ex) { // for some reason the value is invalid so continue as if there was no value there - _logger.LogWarning(ex, "Could not parse current db value to a JObject."); + _logger.LogWarning(ex, "Could not parse current db value to a JObject."); } if (string.IsNullOrWhiteSpace(currentPath) == false) currentPath = _mediaFileSystem.GetRelativePath(currentPath); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs index 93b71e9b2d..70d3aa53e6 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs @@ -143,7 +143,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.RawPropertyValues.Remove(prop.Key); - _logger.LogWarning( + _logger.LogWarning( ex, "ConvertDbToString removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Id, propertyType.Alias); @@ -212,7 +212,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.RawPropertyValues.Remove(prop.Key); - _logger.LogWarning( + _logger.LogWarning( ex, "ToEditor removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Id, property.PropertyType.Alias); diff --git a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs index e50b3e9416..5141d30f9a 100644 --- a/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs +++ b/src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs @@ -120,7 +120,7 @@ namespace Umbraco.Core.Runtime { if (_errorDuringAcquiring) { - _logger.LogWarning("Could not acquire MainDom, listening is canceled."); + _logger.LogWarning("Could not acquire MainDom, listening is canceled."); return Task.CompletedTask; } diff --git a/src/Umbraco.Infrastructure/RuntimeState.cs b/src/Umbraco.Infrastructure/RuntimeState.cs index 7f6359d15e..d48eb73c98 100644 --- a/src/Umbraco.Infrastructure/RuntimeState.cs +++ b/src/Umbraco.Infrastructure/RuntimeState.cs @@ -122,7 +122,7 @@ namespace Umbraco.Core catch (Exception e) { // can connect to the database but cannot check the upgrade state... oops - _logger.LogWarning(e, "Could not check the upgrade state."); + _logger.LogWarning(e, "Could not check the upgrade state."); if (_globalSettings.InstallEmptyDatabase) { diff --git a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs index 56bf1ebe94..2664b4b2f6 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs @@ -1481,7 +1481,7 @@ namespace Umbraco.Core.Services.Implement var impact = CultureImpact.Explicit(culture, IsDefaultCulture(allLangs.Value, culture)); var tryPublish = d.PublishCulture(impact) && _propertyValidationService.Value.IsPropertyDataValid(d, out invalidProperties, impact); if (invalidProperties != null && invalidProperties.Length > 0) - Logger.LogWarning("Scheduled publishing will fail for document {DocumentId} and culture {Culture} because of invalid properties {InvalidProperties}", + Logger.LogWarning("Scheduled publishing will fail for document {DocumentId} and culture {Culture} because of invalid properties {InvalidProperties}", d.Id, culture, string.Join(",", invalidProperties.Select(x => x.Alias))); publishing &= tryPublish; //set the culture to be published diff --git a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs index b182fbfa4c..86612f7a7e 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs @@ -104,7 +104,7 @@ namespace Umbraco.Core.Services.Implement { if (xmlSource.ContainsKey(culture) == false) { - _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); return result; } @@ -124,7 +124,7 @@ namespace Umbraco.Core.Services.Implement { if (_dictionarySource.ContainsKey(culture) == false) { - _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); return result; } @@ -207,7 +207,7 @@ namespace Umbraco.Core.Services.Implement { if (_dictionarySource.ContainsKey(culture) == false) { - _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); return "[" + key + "]"; } @@ -245,7 +245,7 @@ namespace Umbraco.Core.Services.Implement { if (xmlSource.ContainsKey(culture) == false) { - _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.LogWarning("The culture specified {Culture} was not found in any configured sources for this service", culture); return "[" + key + "]"; } diff --git a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs index a069e85410..30c03f1478 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Services.Implement if (fileSourceFolder.Exists == false) { - Current.Logger.LogWarning("The folder does not exist: {FileSourceFolder}, therefore no sources will be discovered", fileSourceFolder.FullName); + Current.Logger.LogWarning("The folder does not exist: {FileSourceFolder}, therefore no sources will be discovered", fileSourceFolder.FullName); } else { @@ -99,7 +99,7 @@ namespace Umbraco.Core.Services.Implement } catch (CultureNotFoundException) { - Current.Logger.LogWarning("The culture {CultureValue} found in the file {CultureFile} is not a valid culture", cultureVal, fileInfo.FullName); + Current.Logger.LogWarning("The culture {CultureValue} found in the file {CultureFile} is not a valid culture", cultureVal, fileInfo.FullName); //If the culture in the file is invalid, we'll just hope the file name is a valid culture below, otherwise // an exception will be thrown. } diff --git a/src/Umbraco.Infrastructure/Services/Implement/UserService.cs b/src/Umbraco.Infrastructure/Services/Implement/UserService.cs index 4868eb7442..730510fca9 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/UserService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/UserService.cs @@ -291,7 +291,7 @@ namespace Umbraco.Core.Services.Implement // if we are upgrading and an exception occurs, log and swallow it if (_isUpgrading == false) throw; - Logger.LogWarning(ex, "An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored"); + Logger.LogWarning(ex, "An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored"); // we don't want the uow to rollback its scope! scope.Complete(); diff --git a/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs index 1dc2af526b..14f3f099e4 100644 --- a/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Infrastructure/Sync/DatabaseServerMessenger.cs @@ -151,7 +151,7 @@ namespace Umbraco.Core.Sync var idle =_syncIdle.WaitOne(5000); if (idle == false) { - Logger.LogWarning("The wait lock timed out, application is shutting down. The current instruction batch will be re-processed."); + Logger.LogWarning("The wait lock timed out, application is shutting down. The current instruction batch will be re-processed."); } }, weight); @@ -187,7 +187,7 @@ namespace Umbraco.Core.Sync { // we haven't synced - in this case we aren't going to sync the whole thing, we will assume this is a new // server and it will need to rebuild it's own caches, eg Lucene or the xml cache file. - Logger.LogWarning("No last synced Id found, this generally means this is a new server/install." + Logger.LogWarning("No last synced Id found, this generally means this is a new server/install." + " The server will build its caches and indexes, and then adjust its last synced Id to the latest found in" + " the database and maintain cache updates based on that Id."); @@ -201,7 +201,7 @@ namespace Umbraco.Core.Sync if (count > Options.MaxProcessingInstructionCount) { //too many instructions, proceed to cold boot - Logger.LogWarning( + Logger.LogWarning( "The instruction count ({InstructionCount}) exceeds the specified MaxProcessingInstructionCount ({MaxProcessingInstructionCount})." + " The server will skip existing instructions, rebuild its caches and indexes entirely, adjust its last synced Id" + " to the latest found in the database and maintain cache updates based on that Id.", diff --git a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs index 75573a2272..e0898f5965 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs @@ -92,7 +92,7 @@ namespace Umbraco.ModelsBuilder.Embedded } catch (TimeoutException) { - _logger.LogWarning("Timeout, models were NOT generated."); + _logger.LogWarning("Timeout, models were NOT generated."); } catch (Exception e) { diff --git a/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs b/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs index 78bf8389e3..eb05130da1 100644 --- a/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs +++ b/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs @@ -215,7 +215,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new InvalidOperationException("Missing cmsContentNu edited content for node " + dto.Id + ", consider rebuilding."); - _logger.LogWarning("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); + _logger.LogWarning("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); } else { @@ -242,7 +242,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new InvalidOperationException("Missing cmsContentNu published content for node " + dto.Id + ", consider rebuilding."); - _logger.LogWarning("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); + _logger.LogWarning("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); } else { diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs index 627e42da98..338d7ff305 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs @@ -108,7 +108,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache else { // this is a property that does not correspond to anything, ignore and log - Current.Logger.LogWarning("Dropping property '{PropertyKey}' because it does not belong to the content type.", i.Key); + Current.Logger.LogWarning("Dropping property '{PropertyKey}' because it does not belong to the content type.", i.Key); } } } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs index ee59b792dc..f9e152bdb7 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs @@ -326,7 +326,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache var miss = Interlocked.CompareExchange(ref _examineIndexMiss, 0, 0); // volatile read if (miss < ExamineIndexMissMax && Interlocked.Increment(ref _examineIndexMiss) == ExamineIndexMissMax) - Current.Logger.LogWarning("Failed ({ExamineIndexMissMax} times) to retrieve medias from Examine index and had to load" + Current.Logger.LogWarning("Failed ({ExamineIndexMissMax} times) to retrieve medias from Examine index and had to load" + " them from DB. This may indicate that the Examine index is corrupted.", ExamineIndexMissMax); return ConvertFromIMedia(media); @@ -344,7 +344,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache : ConvertFromXPathNavigator(media.Current); } - Current.Logger.LogWarning("Could not retrieve media {MediaId} from Examine index or from legacy library.GetMedia method", id); + Current.Logger.LogWarning("Could not retrieve media {MediaId} from Examine index or from legacy library.GetMedia method", id); return null; } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs index b15a869821..895e13fe42 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs @@ -287,7 +287,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache if (XmlIsImmutable == false) //Current.Logger.LogWarning("Running with CloneXmlContent being false is a bad idea."); - Current.Logger.LogWarning("CloneXmlContent is false - ignored, we always clone."); + Current.Logger.LogWarning("CloneXmlContent is false - ignored, we always clone."); // note: if SyncFromXmlFile then we should also disable / warn that local edits are going to cause issues... } @@ -797,7 +797,7 @@ AND (umbracoNode.id=@id)"; } catch (FileNotFoundException) { - Current.Logger.LogWarning("Failed to load Xml, file does not exist."); + Current.Logger.LogWarning("Failed to load Xml, file does not exist."); return null; } catch (Exception ex) diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs index d719875ffb..14769e02cd 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs @@ -135,7 +135,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache if (runNow) //Run(); - _logger.LogWarning("Cannot write now because we are going down, changes may be lost."); + _logger.LogWarning("Cannot write now because we are going down, changes may be lost."); return ret; // this, by default, unless we created a new one } diff --git a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs index e670f95d6a..25cae69900 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs @@ -357,13 +357,13 @@ namespace Umbraco.Web.BackOffice.Controllers var unlockResult = await _userManager.SetLockoutEndDateAsync(identityUser, DateTimeOffset.Now); if (unlockResult.Succeeded == false) { - _logger.LogWarning("Could not unlock for user {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First().Description); + _logger.LogWarning("Could not unlock for user {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First().Description); } var resetAccessFailedCountResult = await _userManager.ResetAccessFailedCountAsync(identityUser); if (resetAccessFailedCountResult.Succeeded == false) { - _logger.LogWarning("Could not reset access failed count {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First().Description); + _logger.LogWarning("Could not reset access failed count {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First().Description); } } diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index 918faef664..c550e44a56 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -80,7 +80,7 @@ namespace Umbraco.Web.BackOffice.Controllers { var viewPath = Path.Combine(_globalSettings.UmbracoPath , Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml") .Replace("\\", "/"); // convert to forward slashes since it's a virtual path - + return await RenderDefaultOrProcessExternalLoginAsync( () => View(viewPath), () => View(viewPath)); @@ -99,7 +99,7 @@ namespace Umbraco.Web.BackOffice.Controllers if (invite == null) { - _logger.LogWarning("VerifyUser endpoint reached with invalid token: NULL"); + _logger.LogWarning("VerifyUser endpoint reached with invalid token: NULL"); return RedirectToAction(nameof(Default)); } @@ -107,7 +107,7 @@ namespace Umbraco.Web.BackOffice.Controllers if (parts.Length != 2) { - _logger.LogWarning("VerifyUser endpoint reached with invalid token: {Invite}", invite); + _logger.LogWarning("VerifyUser endpoint reached with invalid token: {Invite}", invite); return RedirectToAction(nameof(Default)); } @@ -116,7 +116,7 @@ namespace Umbraco.Web.BackOffice.Controllers var decoded = token.FromUrlBase64(); if (decoded.IsNullOrWhiteSpace()) { - _logger.LogWarning("VerifyUser endpoint reached with invalid token: {Invite}", invite); + _logger.LogWarning("VerifyUser endpoint reached with invalid token: {Invite}", invite); return RedirectToAction(nameof(Default)); } @@ -125,7 +125,7 @@ namespace Umbraco.Web.BackOffice.Controllers var identityUser = await _userManager.FindByIdAsync(id); if (identityUser == null) { - _logger.LogWarning("VerifyUser endpoint reached with non existing user: {UserId}", id); + _logger.LogWarning("VerifyUser endpoint reached with non existing user: {UserId}", id); return RedirectToAction(nameof(Default)); } @@ -133,7 +133,7 @@ namespace Umbraco.Web.BackOffice.Controllers if (result.Succeeded == false) { - _logger.LogWarning("Could not verify email, Error: {Errors}, Token: {Invite}", result.Errors.ToErrorMessage(), invite); + _logger.LogWarning("Could not verify email, Error: {Errors}, Token: {Invite}", result.Errors.ToErrorMessage(), invite); return new RedirectResult(Url.Action(nameof(Default)) + "#/login/false?invite=3"); } diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs index 7ef7b75cea..30fecbc93c 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs @@ -1619,7 +1619,7 @@ namespace Umbraco.Web.Editors var sortResult = contentService.Sort(sorted.IdSortOrder, _webSecurity.CurrentUser.Id); if (!sortResult.Success) { - Logger.LogWarning("Content sorting failed, this was probably caused by an event being cancelled"); + Logger.LogWarning("Content sorting failed, this was probably caused by an event being cancelled"); // TODO: Now you can cancel sorting, does the event messages bubble up automatically? throw HttpResponseException.CreateValidationErrorResponse("Content sorting failed, this was probably caused by an event being cancelled"); } @@ -2001,7 +2001,7 @@ namespace Umbraco.Web.Editors if (template == null) { //ModelState.AddModelError("Template", "No template exists with the specified alias: " + contentItem.TemplateAlias); - Logger.LogWarning("No template exists with the specified alias: {TemplateAlias}", contentSave.TemplateAlias); + Logger.LogWarning("No template exists with the specified alias: {TemplateAlias}", contentSave.TemplateAlias); } else if (template.Id != contentSave.PersistedContent.TemplateId) { diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentControllerBase.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentControllerBase.cs index 2313e9b5f7..08a1e8cbce 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentControllerBase.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentControllerBase.cs @@ -78,7 +78,7 @@ namespace Umbraco.Web.BackOffice.Controllers // get the property editor if (propertyDto.PropertyEditor == null) { - Logger.LogWarning("No property editor found for property {PropertyAlias}", propertyDto.Alias); + Logger.LogWarning("No property editor found for property {PropertyAlias}", propertyDto.Alias); continue; } diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs index 53497225b6..1b317b8427 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs @@ -461,7 +461,7 @@ namespace Umbraco.Web.BackOffice.Controllers var tryCreateTemplate = _fileService.CreateTemplateForContentType(contentTypeAlias, contentTypeName); if (tryCreateTemplate == false) { - _logger.LogWarning("Could not create a template for Content Type: \"{ContentTypeAlias}\", status: {Status}", + _logger.LogWarning("Could not create a template for Content Type: \"{ContentTypeAlias}\", status: {Status}", contentTypeAlias, tryCreateTemplate.Result.Result); } diff --git a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs index 5bf7bfe30c..94e5b58095 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs @@ -622,7 +622,7 @@ namespace Umbraco.Web.BackOffice.Controllers // Save Media with new sort order and update content xml in db accordingly if (mediaService.Sort(sortedMedia) == false) { - Logger.LogWarning("Media sorting failed, this was probably caused by an event being cancelled"); + Logger.LogWarning("Media sorting failed, this was probably caused by an event being cancelled"); throw HttpResponseException.CreateValidationErrorResponse("Media sorting failed, this was probably caused by an event being cancelled"); } return Ok(); diff --git a/src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs b/src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs index 73746704e6..6e47c900f3 100644 --- a/src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs +++ b/src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs @@ -144,7 +144,7 @@ namespace Umbraco.Web.BackOffice.Filters { var message = $"Could not find property editor \"{p.DataType.EditorAlias}\" for property with id {p.Id}."; - Logger.LogWarning(message); + Logger.LogWarning(message); continue; } diff --git a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs index c9d7789797..6ac3727114 100644 --- a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs @@ -86,20 +86,20 @@ namespace Umbraco.Web.WebApi.Filters { if (context == null) { - _logger.LogWarning("The context is null!!??"); + _logger.LogWarning("The context is null!!??"); return Task.CompletedTask; } if (context.Result == null) { - _logger.LogWarning( + _logger.LogWarning( "The context.Result is null!!??"); return Task.CompletedTask; } if(!(context.Result is ObjectResult objectResult)) { - _logger.LogWarning( + _logger.LogWarning( "Could not acquire context.Result as ObjectResult"); return Task.CompletedTask; } @@ -138,20 +138,20 @@ namespace Umbraco.Web.WebApi.Filters } else { - _logger.LogWarning( + _logger.LogWarning( "The f.TempFilePath is null or whitespace!!??"); } } } else { - _logger.LogWarning( + _logger.LogWarning( "The uploadedFiles.UploadedFiles is null!!??"); } } else { - _logger.LogWarning( + _logger.LogWarning( "The actionExecutedContext.Request.Content.Value is not IHaveUploadedFiles, it is {ObjectType}", objectResult.Value.GetType()); } diff --git a/src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs b/src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs index 78fc5329c3..d5793ffaac 100644 --- a/src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs +++ b/src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web.BackOffice.Security if (resetResult.Succeeded == false) { var errors = resetResult.Errors.ToErrorMessage(); - _logger.LogWarning("Could not reset user password {PasswordErrors}", errors); + _logger.LogWarning("Could not reset user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "value" }) }); } @@ -92,7 +92,7 @@ namespace Umbraco.Web.BackOffice.Security { //no, fail with error messages for "password" var errors = changeResult.Errors.ToErrorMessage(); - _logger.LogWarning("Could not change user password {PasswordErrors}", errors); + _logger.LogWarning("Could not change user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "password" }) }); } return Attempt.Succeed(new PasswordChangedModel()); diff --git a/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs index fcaeef977a..e673ddde96 100644 --- a/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs @@ -196,7 +196,7 @@ namespace Umbraco.Web.Trees // TODO: in the future we could return a validation statement so we can have some UI to notify the user they don't have access if (ignoreUserStartNodes == false && HasPathAccess(id, queryStrings) == false) { - _logger.LogWarning("User {Username} does not have access to node with id {Id}", _webSecurity.CurrentUser.Username, id); + _logger.LogWarning("User {Username} does not have access to node with id {Id}", _webSecurity.CurrentUser.Username, id); return nodes; } diff --git a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs index 48360650d7..fe46349559 100644 --- a/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/UmbracoRequestMiddleware.cs @@ -55,7 +55,7 @@ namespace Umbraco.Web.Common.Middleware if (umbracoContextReference.UmbracoContext.IsFrontEndUmbracoRequest) { LogHttpRequest.TryGetCurrentHttpRequestId(out var httpRequestId, _requestCache); - _logger.Verbose("Begin request [{HttpRequestId}]: {RequestUrl}", httpRequestId, requestUri); + _logger.LogTrace("Begin request [{HttpRequestId}]: {RequestUrl}", httpRequestId, requestUri); } try @@ -84,7 +84,7 @@ namespace Umbraco.Web.Common.Middleware if (umbracoContextReference.UmbracoContext.IsFrontEndUmbracoRequest) { LogHttpRequest.TryGetCurrentHttpRequestId(out var httpRequestId, _requestCache); - _logger.Verbose("End Request [{HttpRequestId}]: {RequestUrl} ({RequestDuration}ms)", httpRequestId, requestUri, DateTime.Now.Subtract(umbracoContextReference.UmbracoContext.ObjectCreated).TotalMilliseconds); + _logger.LogTrace("End Request [{HttpRequestId}]: {RequestUrl} ({RequestDuration}ms)", httpRequestId, requestUri, DateTime.Now.Subtract(umbracoContextReference.UmbracoContext.ObjectCreated).TotalMilliseconds); } try diff --git a/src/Umbraco.Web/CdfLogger.cs b/src/Umbraco.Web/CdfLogger.cs index a89035e220..462a0bf7b8 100644 --- a/src/Umbraco.Web/CdfLogger.cs +++ b/src/Umbraco.Web/CdfLogger.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web public void Warn(string msg) { - _logger.LogWarning(msg); + _logger.LogWarning(msg); } public void Error(string msg, Exception ex) diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index c8b14f4a4a..f3cc3b6185 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -176,7 +176,7 @@ namespace Umbraco.Web.Editors var authType = OwinContext.Authentication.GetExternalAuthenticationTypes().FirstOrDefault(x => x.AuthenticationType == loginInfo.Login.LoginProvider); if (authType == null) { - Logger.LogWarning("Could not find external authentication provider registered: {LoginProvider}", loginInfo.Login.LoginProvider); + Logger.LogWarning("Could not find external authentication provider registered: {LoginProvider}", loginInfo.Login.LoginProvider); } else { @@ -199,7 +199,7 @@ namespace Umbraco.Web.Editors shouldSignIn = autoLinkOptions.OnExternalLogin(user, loginInfo); if (shouldSignIn == false) { - Logger.LogWarning("The AutoLinkOptions of the external authentication provider '{LoginProvider}' have refused the login based on the OnExternalLogin method. Affected user id: '{UserId}'", loginInfo.Login.LoginProvider, user.Id); + Logger.LogWarning("The AutoLinkOptions of the external authentication provider '{LoginProvider}' have refused the login based on the OnExternalLogin method. Affected user id: '{UserId}'", loginInfo.Login.LoginProvider, user.Id); } } diff --git a/src/Umbraco.Web/Editors/PasswordChanger.cs b/src/Umbraco.Web/Editors/PasswordChanger.cs index 4267c4327f..06b4ea3367 100644 --- a/src/Umbraco.Web/Editors/PasswordChanger.cs +++ b/src/Umbraco.Web/Editors/PasswordChanger.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Editors if (resetResult.Succeeded == false) { var errors = resetResult.Errors.ToErrorMessage(); - _logger.LogWarning("Could not reset user password {PasswordErrors}", errors); + _logger.LogWarning("Could not reset user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "value" }) }); } @@ -93,7 +93,7 @@ namespace Umbraco.Web.Editors { //no, fail with error messages for "password" var errors = changeResult.Errors.ToErrorMessage(); - _logger.LogWarning("Could not change user password {PasswordErrors}", errors); + _logger.LogWarning("Could not change user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "password" }) }); } return Attempt.Succeed(new PasswordChangedModel()); diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index 6b6924e8de..2f8b5c863f 100644 --- a/src/Umbraco.Web/Mvc/RenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs @@ -68,7 +68,7 @@ namespace Umbraco.Web.Mvc var result = ViewEngines.Engines.FindView(ControllerContext, template, null); if (result.View != null) return true; - Logger.LogWarning("No physical template file was found for template {Template}", template); + Logger.LogWarning("No physical template file was found for template {Template}", template); return false; } diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index af74e1da08..e9e05f40ef 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -280,7 +280,7 @@ namespace Umbraco.Web.Mvc } else { - Current.Logger.LogWarning("The current Document Type {ContentTypeAlias} matches a locally declared controller of type {ControllerName}. Custom Controllers for Umbraco routing must implement '{UmbracoRenderController}' and inherit from '{UmbracoControllerBase}'.", + Current.Logger.LogWarning("The current Document Type {ContentTypeAlias} matches a locally declared controller of type {ControllerName}. Custom Controllers for Umbraco routing must implement '{UmbracoRenderController}' and inherit from '{UmbracoControllerBase}'.", request.PublishedContent.ContentType.Alias, controllerType.FullName, typeof(IRenderController).FullName, diff --git a/src/Umbraco.Web/Security/MembershipHelper.cs b/src/Umbraco.Web/Security/MembershipHelper.cs index ffbf5a5b09..0ad586616e 100644 --- a/src/Umbraco.Web/Security/MembershipHelper.cs +++ b/src/Umbraco.Web/Security/MembershipHelper.cs @@ -305,7 +305,7 @@ namespace Umbraco.Web.Security if (member == null) { //this should not happen - Current.Logger.LogWarning("The member validated but then no member was returned with the username {Username}", username); + Current.Logger.LogWarning("The member validated but then no member was returned with the username {Username}", username); return false; } //Log them in @@ -847,7 +847,7 @@ namespace Umbraco.Web.Security } catch (Exception ex) { - _logger.LogWarning(ex, "Could not change member password"); + _logger.LogWarning(ex, "Could not change member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex.Message + " (see log for full details)", new[] { "value" }) }); } diff --git a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs index 7c4dff1702..81bd2b161d 100644 --- a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs @@ -131,7 +131,7 @@ namespace Umbraco.Web.Security.Providers if (MemberService.Exists(username)) { status = MembershipCreateStatus.DuplicateUserName; - Current.Logger.LogWarning>("Cannot create member as username already exists: {Username}", username); + Current.Logger.LogWarning("Cannot create member as username already exists: {Username}", username); return null; } @@ -139,7 +139,7 @@ namespace Umbraco.Web.Security.Providers if (MemberService.GetByEmail(email) != null && RequiresUniqueEmail) { status = MembershipCreateStatus.DuplicateEmail; - Current.Logger.LogWarning>("Cannot create member as a member with the same email address exists: {Email}", email); + Current.Logger.LogWarning("Cannot create member as a member with the same email address exists: {Email}", email); return null; } diff --git a/src/Umbraco.Web/UmbracoInjectedModule.cs b/src/Umbraco.Web/UmbracoInjectedModule.cs index b0510fb4ca..66ae70be44 100644 --- a/src/Umbraco.Web/UmbracoInjectedModule.cs +++ b/src/Umbraco.Web/UmbracoInjectedModule.cs @@ -229,7 +229,7 @@ namespace Umbraco.Web if (context.Content.HasContent()) return true; - _logger.LogWarning("Umbraco has no content"); + _logger.LogWarning("Umbraco has no content"); if (RouteTable.Routes[Constants.Web.NoContentRouteName] is Route route) { @@ -297,7 +297,7 @@ namespace Umbraco.Web } - + #endregion #region IHttpModule diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index e5b7914626..db10ede0c5 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -78,7 +78,7 @@ namespace Umbraco.Web response.TrySkipIisCustomErrors = Current.Configs.WebRouting().TrySkipIisCustomErrors; if (response.TrySkipIisCustomErrors == false) - logger.LogWarning("Status code is 404 yet TrySkipIisCustomErrors is false - IIS will take over."); + logger.LogWarning("Status code is 404 yet TrySkipIisCustomErrors is false - IIS will take over."); } if (pcr.ResponseStatusCode > 0) diff --git a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs index b441a6228a..e0b5bbcc23 100644 --- a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs @@ -67,17 +67,17 @@ namespace Umbraco.Web.WebApi.Filters { if (actionExecutedContext == null) { - Current.Logger.LogWarning("The actionExecutedContext is null!!??"); + Current.Logger.LogWarning("The actionExecutedContext is null!!??"); return; } if (actionExecutedContext.Request == null) { - Current.Logger.LogWarning("The actionExecutedContext.Request is null!!??"); + Current.Logger.LogWarning("The actionExecutedContext.Request is null!!??"); return; } if (actionExecutedContext.Request.Content == null) { - Current.Logger.LogWarning("The actionExecutedContext.Request.Content is null!!??"); + Current.Logger.LogWarning("The actionExecutedContext.Request.Content is null!!??"); return; } @@ -127,23 +127,23 @@ namespace Umbraco.Web.WebApi.Filters } else { - Current.Logger.LogWarning("The f.TempFilePath is null or whitespace!!??"); + Current.Logger.LogWarning("The f.TempFilePath is null or whitespace!!??"); } } } else { - Current.Logger.LogWarning("The uploadedFiles.UploadedFiles is null!!??"); + Current.Logger.LogWarning("The uploadedFiles.UploadedFiles is null!!??"); } } else { - Current.Logger.LogWarning("The actionExecutedContext.Request.Content.Value is not IHaveUploadedFiles, it is {ObjectType}", objectContent.Value.GetType()); + Current.Logger.LogWarning("The actionExecutedContext.Request.Content.Value is not IHaveUploadedFiles, it is {ObjectType}", objectContent.Value.GetType()); } } else { - Current.Logger.LogWarning("The actionExecutedContext.Request.Content is not ObjectContent, it is {RequestObjectType}", actionExecutedContext.Request.Content.GetType()); + Current.Logger.LogWarning("The actionExecutedContext.Request.Content is not ObjectContent, it is {RequestObjectType}", actionExecutedContext.Request.Content.GetType()); } } }