From a1ecc4a5c955d55c181ddd8d0aba7eb72f39cb80 Mon Sep 17 00:00:00 2001 From: Nikolaj Date: Mon, 14 Sep 2020 10:17:32 +0200 Subject: [PATCH] Change Warn to LogWarning --- src/Umbraco.Core/Composing/TypeFinder.cs | 2 +- src/Umbraco.Core/Composing/TypeLoader.cs | 2 +- .../ContentApps/ContentAppFactoryCollection.cs | 2 +- src/Umbraco.Core/Logging/ConsoleLogger.cs | 8 ++++---- .../Logging/DebugDiagnosticsLogger.cs | 8 ++++---- src/Umbraco.Core/Logging/ILogger.cs | 8 ++++---- src/Umbraco.Core/Logging/LoggerExtensions.cs | 16 ++++++++-------- src/Umbraco.Core/Logging/NullLogger.cs | 8 ++++---- src/Umbraco.Core/Logging/ProfilingLogger.cs | 16 ++++++++-------- src/Umbraco.Core/Models/Member.cs | 4 ++-- .../Packaging/PackageDefinitionXmlParser.cs | 2 +- src/Umbraco.Core/Packaging/PackagesRepository.cs | 2 +- .../Routing/ContentFinderByUrlAndTemplate.cs | 2 +- src/Umbraco.Core/Routing/PublishedRouter.cs | 2 +- src/Umbraco.Core/Runtime/MainDom.cs | 4 ++-- src/Umbraco.Core/Scheduling/KeepAlive.cs | 2 +- .../LuceneIndexDiagnostics.cs | 4 ++-- .../BatchedDatabaseServerMessenger.cs | 2 +- .../Cache/DistributedCacheBinder.cs | 2 +- .../Compose/NotificationsComponent.cs | 4 ++-- .../HealthCheck/HealthCheckResults.cs | 2 +- .../Upgrade/V_8_0_0/DataTypeMigration.cs | 6 +++--- .../V_8_0_0/PropertyEditorsMigrationBase.cs | 2 +- .../Models/Mapping/DataTypeMapDefinition.cs | 2 +- .../Models/Mapping/MacroMapDefinition.cs | 2 +- .../Models/PathValidationExtensions.cs | 2 +- .../Models/PropertyTagsExtensions.cs | 2 +- .../Packaging/PackageDataInstallation.cs | 8 ++++---- .../Persistence/DbConnectionExtensions.cs | 2 +- .../Persistence/Factories/DataTypeFactory.cs | 2 +- .../Implement/ContentRepositoryBase.cs | 2 +- .../Implement/ContentTypeRepositoryBase.cs | 2 +- .../Repositories/Implement/LanguageRepository.cs | 2 +- .../PropertyEditors/BlockEditorPropertyEditor.cs | 4 ++-- .../PropertyEditors/DataValueEditor.cs | 2 +- .../ImageCropperPropertyValueEditor.cs | 2 +- .../NestedContentPropertyEditor.cs | 4 ++-- .../Runtime/SqlMainDomLock.cs | 2 +- src/Umbraco.Infrastructure/RuntimeState.cs | 2 +- .../Search/BackgroundIndexRebuilder.cs | 2 +- .../Services/Implement/ContentService.cs | 2 +- .../Services/Implement/LocalizedTextService.cs | 8 ++++---- .../Implement/LocalizedTextServiceFileSources.cs | 4 ++-- .../Services/Implement/UserService.cs | 2 +- .../Sync/DatabaseServerMessenger.cs | 6 +++--- .../LiveModelsProvider.cs | 2 +- .../PureLiveModelFactory.cs | 2 +- .../ContentStore.cs | 8 ++++---- .../DataSource/DatabaseDataSource.cs | 4 ++-- .../PublishedSnapshotService.cs | 4 ++-- .../DictionaryPublishedContent.cs | 2 +- .../PublishedMediaCache.cs | 4 ++-- .../XmlStoreFilePersister.cs | 2 +- .../Controllers/AuthenticationController.cs | 4 ++-- .../Controllers/BackOfficeController.cs | 10 +++++----- .../Controllers/ContentController.cs | 4 ++-- .../Controllers/ContentControllerBase.cs | 2 +- .../Controllers/ContentTypeController.cs | 2 +- .../Controllers/MediaController.cs | 2 +- .../Filters/ContentModelValidator.cs | 2 +- .../Filters/FileUploadCleanupFilterAttribute.cs | 12 ++++++------ .../Security/PasswordChanger.cs | 4 ++-- .../Trees/ContentTreeControllerBase.cs | 2 +- .../Install/InstallController.cs | 2 +- src/Umbraco.Web.Common/Macros/MacroRenderer.cs | 2 +- src/Umbraco.Web/CdfLogger.cs | 2 +- .../Editors/AuthenticationController.cs | 6 +++--- src/Umbraco.Web/Editors/BackOfficeController.cs | 4 ++-- src/Umbraco.Web/Editors/PasswordChanger.cs | 4 ++-- src/Umbraco.Web/Logging/OwinLogger.cs | 2 +- src/Umbraco.Web/Macros/MacroRenderer.cs | 2 +- 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/UmbracoHelper.cs | 2 +- src/Umbraco.Web/UmbracoInjectedModule.cs | 2 +- src/Umbraco.Web/UmbracoModule.cs | 2 +- .../Filters/FileUploadCleanupFilterAttribute.cs | 14 +++++++------- 79 files changed, 152 insertions(+), 152 deletions(-) diff --git a/src/Umbraco.Core/Composing/TypeFinder.cs b/src/Umbraco.Core/Composing/TypeFinder.cs index 82c5bdba9d..efd3a6cb23 100644 --- a/src/Umbraco.Core/Composing/TypeFinder.cs +++ b/src/Umbraco.Core/Composing/TypeFinder.cs @@ -442,7 +442,7 @@ namespace Umbraco.Core.Composing if (_notifiedLoadExceptionAssemblies.Contains(a.FullName) == false) { _notifiedLoadExceptionAssemblies.Add(a.FullName); - _logger.Warn(typeof (TypeFinder), ex, "Could not load all types from {TypeName}.", a.GetName().Name); + _logger.LogWarning(typeof (TypeFinder), ex, "Could not load all types from {TypeName}.", a.GetName().Name); } } return rex.Types.WhereNotNull().ToArray(); diff --git a/src/Umbraco.Core/Composing/TypeLoader.cs b/src/Umbraco.Core/Composing/TypeLoader.cs index 1d40149936..b10063e563 100644 --- a/src/Umbraco.Core/Composing/TypeLoader.cs +++ b/src/Umbraco.Core/Composing/TypeLoader.cs @@ -674,7 +674,7 @@ namespace Umbraco.Core.Composing else { // in case of any exception, we have to exit, and revert to scanning - _logger.Warn("Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type); + _logger.LogWarning("Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type); scan = true; break; } diff --git a/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs b/src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs index 4e85e51af3..d79485fe7e 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.Warn("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/ConsoleLogger.cs b/src/Umbraco.Core/Logging/ConsoleLogger.cs index b4911d489d..e44d6b4b83 100644 --- a/src/Umbraco.Core/Logging/ConsoleLogger.cs +++ b/src/Umbraco.Core/Logging/ConsoleLogger.cs @@ -70,23 +70,23 @@ namespace Umbraco.Core.Logging Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues)); } - public void Warn(Type reporting, string message) + public void LogWarning(Type reporting, string message) { Console.WriteLine("WARN {0} - {1}", reporting.Name, message); } - public void Warn(Type reporting, string message, params object[] propertyValues) + public void LogWarning(Type reporting, string message, params object[] propertyValues) { Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues)); } - public void Warn(Type reporting, Exception exception, string message) + public void LogWarning(Type reporting, Exception exception, string message) { Console.WriteLine("WARN {0} - {1}", reporting.Name, message); Console.WriteLine(exception); } - public void Warn(Type reporting, Exception exception, string message, params object[] propertyValues) + public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues) { Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues)); Console.WriteLine(exception); diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index 1c3af3b36b..dec3fc6c24 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -78,25 +78,25 @@ namespace Umbraco.Core.Logging } /// - public void Warn(Type reporting, string message) + public void LogWarning(Type reporting, string message) { System.Diagnostics.Debug.WriteLine(message, reporting.FullName); } /// - public void Warn(Type reporting, string message, params object[] propertyValues) + public void LogWarning(Type reporting, string message, params object[] propertyValues) { System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message, propertyValues), reporting.FullName); } /// - public void Warn(Type reporting, Exception exception, string message) + public void LogWarning(Type reporting, Exception exception, string message) { System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName); } /// - public void Warn(Type reporting, Exception exception, string message, params object[] propertyValues) + public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues) { System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message + Environment.NewLine + exception, propertyValues), reporting.FullName); } diff --git a/src/Umbraco.Core/Logging/ILogger.cs b/src/Umbraco.Core/Logging/ILogger.cs index 737b4c03f1..e56b20f5a3 100644 --- a/src/Umbraco.Core/Logging/ILogger.cs +++ b/src/Umbraco.Core/Logging/ILogger.cs @@ -107,7 +107,7 @@ namespace Umbraco.Core.Logging /// /// The reporting type. /// A message. - void Warn(Type reporting, string message); + void LogWarning(Type reporting, string message); /// /// Logs a warning message. @@ -115,7 +115,7 @@ namespace Umbraco.Core.Logging /// The reporting type. /// A message template. /// Property values. - void Warn(Type reporting, string messageTemplate, params object[] propertyValues); + void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues); /// /// Logs a warning message with an exception. @@ -123,7 +123,7 @@ namespace Umbraco.Core.Logging /// The reporting type. /// An exception. /// A message. - void Warn(Type reporting, Exception exception, string message); + void LogWarning(Type reporting, Exception exception, string message); /// /// Logs a warning message with an exception. @@ -132,7 +132,7 @@ namespace Umbraco.Core.Logging /// An exception. /// A message template. /// Property values. - void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); + void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); /// /// Logs an information message. diff --git a/src/Umbraco.Core/Logging/LoggerExtensions.cs b/src/Umbraco.Core/Logging/LoggerExtensions.cs index 5b86e28946..e75e66318c 100644 --- a/src/Umbraco.Core/Logging/LoggerExtensions.cs +++ b/src/Umbraco.Core/Logging/LoggerExtensions.cs @@ -71,8 +71,8 @@ namespace Umbraco.Core.Logging /// The reporting type. /// The logger. /// A message. - public static void Warn(this ILogger logger, string message) - => logger.Warn(typeof(T), message); + public static void LogWarning(this ILogger logger, string message) + => logger.LogWarning(typeof(T), message); /// /// Logs a warning message. @@ -81,8 +81,8 @@ namespace Umbraco.Core.Logging /// The logger. /// A message template. /// Property values. - public static void Warn(this ILogger logger, string messageTemplate, params object[] propertyValues) - => logger.Warn(typeof(T), messageTemplate, propertyValues); + public static void LogWarning(this ILogger logger, string messageTemplate, params object[] propertyValues) + => logger.LogWarning(typeof(T), messageTemplate, propertyValues); /// /// Logs a warning message with an exception. @@ -91,8 +91,8 @@ namespace Umbraco.Core.Logging /// The logger. /// An exception. /// A message. - public static void Warn(this ILogger logger, Exception exception, string message) - => logger.Warn(typeof(T), exception, message); + public static void LogWarning(this ILogger logger, Exception exception, string message) + => logger.LogWarning(typeof(T), exception, message); /// /// Logs a warning message with an exception. @@ -102,8 +102,8 @@ namespace Umbraco.Core.Logging /// An exception. /// A message template. /// Property values. - public static void Warn(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) - => logger.Warn(typeof(T), exception, messageTemplate, propertyValues); + public static void LogWarning(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues) + => logger.LogWarning(typeof(T), exception, messageTemplate, propertyValues); /// /// Logs an information message. diff --git a/src/Umbraco.Core/Logging/NullLogger.cs b/src/Umbraco.Core/Logging/NullLogger.cs index 3b40efe78e..d3f29168a0 100644 --- a/src/Umbraco.Core/Logging/NullLogger.cs +++ b/src/Umbraco.Core/Logging/NullLogger.cs @@ -56,22 +56,22 @@ namespace Umbraco.Core.Logging } - public void Warn(Type reporting, string message) + public void LogWarning(Type reporting, string message) { } - public void Warn(Type reporting, string messageTemplate, params object[] propertyValues) + public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues) { } - public void Warn(Type reporting, Exception exception, string message) + public void LogWarning(Type reporting, Exception exception, string message) { } - public void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) { } diff --git a/src/Umbraco.Core/Logging/ProfilingLogger.cs b/src/Umbraco.Core/Logging/ProfilingLogger.cs index 3d323fe0dd..e6db3516ad 100644 --- a/src/Umbraco.Core/Logging/ProfilingLogger.cs +++ b/src/Umbraco.Core/Logging/ProfilingLogger.cs @@ -97,17 +97,17 @@ namespace Umbraco.Core.Logging public void LogError(Type reporting, string messageTemplate, params object[] propertyValues) => Logger.LogError(reporting, messageTemplate, propertyValues); - public void Warn(Type reporting, string message) - => Logger.Warn(reporting, message); + public void LogWarning(Type reporting, string message) + => Logger.LogWarning(reporting, message); - public void Warn(Type reporting, string messageTemplate, params object[] propertyValues) - => Logger.Warn(reporting, messageTemplate, propertyValues); + public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues) + => Logger.LogWarning(reporting, messageTemplate, propertyValues); - public void Warn(Type reporting, Exception exception, string message) - => Logger.Warn(reporting, exception, message); + public void LogWarning(Type reporting, Exception exception, string message) + => Logger.LogWarning(reporting, exception, message); - public void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) - => Logger.Warn(reporting, exception, messageTemplate, propertyValues); + public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues) + => Logger.LogWarning(reporting, exception, messageTemplate, propertyValues); public void Info(Type reporting, string message) => Logger.Info(reporting, message); diff --git a/src/Umbraco.Core/Models/Member.cs b/src/Umbraco.Core/Models/Member.cs index 706729b71a..52a887bbfb 100644 --- a/src/Umbraco.Core/Models/Member.cs +++ b/src/Umbraco.Core/Models/Member.cs @@ -472,7 +472,7 @@ namespace Umbraco.Core.Models { void DoLog(string logPropertyAlias, string logPropertyName) { - Current.Logger.Warn("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.Warn("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), diff --git a/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs b/src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs index d28ee828c5..553346ad70 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.Warn(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 0764378b06..9ab36d0988 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.Warn(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 7bcea4681e..a756a4a6b5 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.Warn("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/Routing/PublishedRouter.cs b/src/Umbraco.Core/Routing/PublishedRouter.cs index 1a422dea92..811e1eea01 100644 --- a/src/Umbraco.Core/Routing/PublishedRouter.cs +++ b/src/Umbraco.Core/Routing/PublishedRouter.cs @@ -685,7 +685,7 @@ namespace Umbraco.Web.Routing } else { - _logger.Warn("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id); + _logger.LogWarning("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id); // no allowed, back to default var templateId = request.PublishedContent.TemplateId; diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs index 9a20e65422..d4aa5d9518 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.Warn("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.Warn(ex, ex.Message); + _logger.LogWarning(ex, ex.Message); } _logger.Info("Acquired."); diff --git a/src/Umbraco.Core/Scheduling/KeepAlive.cs b/src/Umbraco.Core/Scheduling/KeepAlive.cs index 5953d60822..513bc31b35 100644 --- a/src/Umbraco.Core/Scheduling/KeepAlive.cs +++ b/src/Umbraco.Core/Scheduling/KeepAlive.cs @@ -61,7 +61,7 @@ namespace Umbraco.Web.Scheduling var umbracoAppUrl = _requestAccessor.GetApplicationUrl().ToString(); if (umbracoAppUrl.IsNullOrWhiteSpace()) { - _logger.Warn("No umbracoApplicationUrl for service (yet), skip."); + _logger.LogWarning("No umbracoApplicationUrl for service (yet), skip."); return true; // repeat } diff --git a/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs b/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs index 836d5f6e66..e4d6460eb4 100644 --- a/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs +++ b/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs @@ -34,7 +34,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - Logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexDocumentCount, the writer is already closed"); + Logger.LogWarning(typeof(UmbracoContentIndex), "Cannot get GetIndexDocumentCount, the writer is already closed"); return 0; } } @@ -50,7 +50,7 @@ namespace Umbraco.Examine } catch (AlreadyClosedException) { - Logger.Warn(typeof(UmbracoContentIndex), "Cannot get GetIndexFieldCount, the writer is already closed"); + Logger.LogWarning(typeof(UmbracoContentIndex), "Cannot get GetIndexFieldCount, the writer is already closed"); return 0; } } diff --git a/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs b/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs index fa76fb6f11..b3c5b00472 100644 --- a/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs +++ b/src/Umbraco.Infrastructure/BatchedDatabaseServerMessenger.cs @@ -52,7 +52,7 @@ namespace Umbraco.Web if (_databaseFactory.CanConnect == false) { - Logger.Warn("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 92ed7de881..ba97415ac0 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.Warn("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/Compose/NotificationsComponent.cs b/src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs index b1303859e0..6dd265483d 100644 --- a/src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs +++ b/src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs @@ -222,7 +222,7 @@ namespace Umbraco.Web.Compose user = _userService.GetUserById(Constants.Security.SuperUserId); if (user == null) { - _logger.Warn(typeof(Notifier), "Notifications can not be sent, no admin user with id {SuperUserId} could be resolved", Constants.Security.SuperUserId); + _logger.LogWarning(typeof(Notifier), "Notifications can not be sent, no admin user with id {SuperUserId} could be resolved", Constants.Security.SuperUserId); return; } } @@ -235,7 +235,7 @@ namespace Umbraco.Web.Compose if (sender == null) throw new ArgumentNullException(nameof(sender)); if (siteUri == null) { - _logger.Warn(typeof(Notifier), "Notifications can not be sent, no site url is set (might be during boot process?)"); + _logger.LogWarning(typeof(Notifier), "Notifications can not be sent, no site url is set (might be during boot process?)"); return; } diff --git a/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs b/src/Umbraco.Infrastructure/HealthCheck/HealthCheckResults.cs index b38e965ea8..a14c59866f 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.Warn("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 95b272dcb4..e5d47ca45c 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.Warn( + _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.Warn("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.Warn(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/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigrationBase.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigrationBase.cs index 5ac92b7966..554402fe38 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigrationBase.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigrationBase.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 continue; } - Logger.Warn(GetType(), "Could not find PropertyData {PropertyDataId} value '{PropertyValue}' in the datatype configuration: {Values}.", + Logger.LogWarning(GetType(), "Could not find PropertyData {PropertyDataId} value '{PropertyValue}' in the datatype configuration: {Values}.", propData.Id, id, string.Join(", ", config.Items.Select(x => x.Id + ":" + x.Value))); canConvert = false; } diff --git a/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs b/src/Umbraco.Infrastructure/Models/Mapping/DataTypeMapDefinition.cs index 0bd6d54c08..6e34e62c80 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.Warn("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 d980958a91..3438f5ecd2 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.Warn("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/Models/PathValidationExtensions.cs b/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs index 2db954b316..ed027026bc 100644 --- a/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs +++ b/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs @@ -88,7 +88,7 @@ namespace Umbraco.Core.Models if (entity.ValidatePath() == false) { - logger.Warn(typeof(PathValidationExtensions), "The content item {EntityId} has an invalid path: {EntityPath} with parentID: {EntityParentId}", entity.Id, entity.Path, entity.ParentId); + logger.LogWarning(typeof(PathValidationExtensions), "The content item {EntityId} has an invalid path: {EntityPath} with parentID: {EntityParentId}", entity.Id, entity.Path, entity.ParentId); if (entity.ParentId == -1) { entity.Path = string.Concat("-1,", entity.Id); diff --git a/src/Umbraco.Infrastructure/Models/PropertyTagsExtensions.cs b/src/Umbraco.Infrastructure/Models/PropertyTagsExtensions.cs index b9e471d961..f2e4bd1074 100644 --- a/src/Umbraco.Infrastructure/Models/PropertyTagsExtensions.cs +++ b/src/Umbraco.Infrastructure/Models/PropertyTagsExtensions.cs @@ -218,7 +218,7 @@ namespace Umbraco.Core.Models } catch (Exception ex) { - Current.Logger.Warn(typeof(PropertyTagsExtensions), ex, "Could not automatically convert stored json value to an enumerable string '{Json}'", value.ToString()); + Current.Logger.LogWarning(typeof(PropertyTagsExtensions), ex, "Could not automatically convert stored json value to an enumerable string '{Json}'", value.ToString()); } break; diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index b2d3c4dc73..1c1ca97f54 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.Warn("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.Warn("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.Warn("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.Warn( + _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 b79b1160b1..66f47bba14 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.Warn(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/Factories/DataTypeFactory.cs b/src/Umbraco.Infrastructure/Persistence/Factories/DataTypeFactory.cs index fa991d6679..71186bfea5 100644 --- a/src/Umbraco.Infrastructure/Persistence/Factories/DataTypeFactory.cs +++ b/src/Umbraco.Infrastructure/Persistence/Factories/DataTypeFactory.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Factories // Check we have an editor for the data type. if (!editors.TryGet(dto.EditorAlias, out var editor)) { - logger.Warn(typeof(DataType), "Could not find an editor with alias {EditorAlias}, treating as Label. " + + logger.LogWarning(typeof(DataType), "Could not find an editor with alias {EditorAlias}, treating as Label. " + "The site may fail to boot and/or load data types and run.", dto.EditorAlias); // Create as special type, which downstream can be handled by converting to a LabelPropertyEditor to make clear diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs index 6c216e938f..215011171c 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.Warn>("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 96e98ae9c4..b481ee2dc7 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.Warn>("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 8ba34c7cdb..be5f8533d2 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.Warn("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 b78cae7ac4..e1d6123107 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.Warn( + _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.Warn("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 9765038adf..73c73f8452 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.Warn("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 1c7c8b922a..929d08c042 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.Warn(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 01a03d36e3..93b71e9b2d 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.Warn( + _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.Warn( + _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 bdb013f83b..20d720ae79 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.Warn("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 9b88430080..7f6359d15e 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.Warn(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/Search/BackgroundIndexRebuilder.cs b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs index 101535a23e..deea247c4b 100644 --- a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs +++ b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs @@ -42,7 +42,7 @@ namespace Umbraco.Web.Search { if (_rebuildOnStartupRunner != null && _rebuildOnStartupRunner.IsRunning) { - _logger.Warn("Call was made to RebuildIndexes but the task runner for rebuilding is already running"); + _logger.LogWarning("Call was made to RebuildIndexes but the task runner for rebuilding is already running"); return; } diff --git a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs index 1c939d4e18..6d35196533 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.Warn("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 4f5121def7..b182fbfa4c 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.Warn("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.Warn("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.Warn("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.Warn("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 2c368871e5..823f5cecad 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.Warn("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.Warn("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 faf7889fbf..4868eb7442 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.Warn(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 6b62002c71..f9556e9408 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.Warn("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.Warn("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.Warn( + 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 5fd48ad40b..4f32457417 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.Warn("Timeout, models were NOT generated."); + _logger.LogWarning("Timeout, models were NOT generated."); } catch (Exception e) { diff --git a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs index 5f04541dcb..c138d68ae9 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs @@ -306,7 +306,7 @@ namespace Umbraco.ModelsBuilder.Embedded try { _logger.LogError("Failed to build models.", e); - _logger.Warn("Running without models."); // be explicit + _logger.LogWarning("Running without models."); // be explicit _errors.Report("Failed to build PureLive models.", e); } finally diff --git a/src/Umbraco.PublishedCache.NuCache/ContentStore.cs b/src/Umbraco.PublishedCache.NuCache/ContentStore.cs index 419011ad3d..4dceb6f550 100644 --- a/src/Umbraco.PublishedCache.NuCache/ContentStore.cs +++ b/src/Umbraco.PublishedCache.NuCache/ContentStore.cs @@ -521,7 +521,7 @@ namespace Umbraco.Web.PublishedCache.NuCache parent = GetParentLink(kit.Node, null); if (parent == null) { - _logger.Warn($"Skip item id={kit.Node.Id}, could not find parent id={kit.Node.ParentContentId}."); + _logger.LogWarning($"Skip item id={kit.Node.Id}, could not find parent id={kit.Node.ParentContentId}."); return false; } @@ -530,21 +530,21 @@ namespace Umbraco.Web.PublishedCache.NuCache // because the data sort operation is by path. if (parent.Value == null) { - _logger.Warn($"Skip item id={kit.Node.Id}, no Data assigned for linked node with path {kit.Node.Path} and parent id {kit.Node.ParentContentId}. This can indicate data corruption for the Path value for node {kit.Node.Id}. See the Health Check dashboard in Settings to resolve data integrity issues."); + _logger.LogWarning($"Skip item id={kit.Node.Id}, no Data assigned for linked node with path {kit.Node.Path} and parent id {kit.Node.ParentContentId}. This can indicate data corruption for the Path value for node {kit.Node.Id}. See the Health Check dashboard in Settings to resolve data integrity issues."); return false; } // make sure the kit is valid if (kit.DraftData == null && kit.PublishedData == null) { - _logger.Warn($"Skip item id={kit.Node.Id}, both draft and published data are null."); + _logger.LogWarning($"Skip item id={kit.Node.Id}, both draft and published data are null."); return false; } // unknown = bad if (_contentTypesById.TryGetValue(kit.ContentTypeId, out var link) == false || link.Value == null) { - _logger.Warn($"Skip item id={kit.Node.Id}, could not find content type id={kit.ContentTypeId}."); + _logger.LogWarning($"Skip item id={kit.Node.Id}, could not find content type id={kit.ContentTypeId}."); return false; } diff --git a/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs b/src/Umbraco.PublishedCache.NuCache/DataSource/DatabaseDataSource.cs index 3fedfbb7eb..78bf8389e3 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.Warn("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.Warn("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.PublishedCache.NuCache/PublishedSnapshotService.cs b/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotService.cs index 815fe0a168..7d41243098 100644 --- a/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotService.cs @@ -243,14 +243,14 @@ namespace Umbraco.Web.PublishedCache.NuCache { okContent = LockAndLoadContent(scope => LoadContentFromLocalDbLocked(true)); if (!okContent) - _logger.Warn("Loading content from local db raised warnings, will reload from database."); + _logger.LogWarning("Loading content from local db raised warnings, will reload from database."); } if (_localMediaDbExists) { okMedia = LockAndLoadMedia(scope => LoadMediaFromLocalDbLocked(true)); if (!okMedia) - _logger.Warn("Loading media from local db raised warnings, will reload from database."); + _logger.LogWarning("Loading media from local db raised warnings, will reload from database."); } if (!okContent) diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs index 04c02f34d2..627e42da98 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.Warn("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 ed84a78304..c0a6dc4f33 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.Warn("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.Warn("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/XmlStoreFilePersister.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs index 56c09b18ac..d719875ffb 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.Warn("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 06eef1c1bb..d8197f71ce 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.Warn("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.Warn("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 1970205ebc..918faef664 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -99,7 +99,7 @@ namespace Umbraco.Web.BackOffice.Controllers if (invite == null) { - _logger.Warn("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.Warn("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.Warn("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.Warn("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.Warn("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 4b5cdc9c7f..c4a56830db 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.Warn("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.Warn("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 9e9f7e8fbd..2313e9b5f7 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.Warn("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 7ea7096a09..dc21196158 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.Warn("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 26c98cb45e..cdac1cdf8f 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.Warn("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 71323b1659..73746704e6 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.Warn(message); + Logger.LogWarning(message); continue; } diff --git a/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/FileUploadCleanupFilterAttribute.cs index a838dea0eb..9e14a4f5db 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.Warn("The context is null!!??"); + _logger.LogWarning("The context is null!!??"); return Task.CompletedTask; } if (context.Result == null) { - _logger.Warn( + _logger.LogWarning( "The context.Result is null!!??"); return Task.CompletedTask; } if(!(context.Result is ObjectResult objectResult)) { - _logger.Warn( + _logger.LogWarning( "Could not acquire context.Result as ObjectResult"); return Task.CompletedTask; } @@ -138,20 +138,20 @@ namespace Umbraco.Web.WebApi.Filters } else { - _logger.Warn( + _logger.LogWarning( "The f.TempFilePath is null or whitespace!!??"); } } } else { - _logger.Warn( + _logger.LogWarning( "The uploadedFiles.UploadedFiles is null!!??"); } } else { - _logger.Warn( + _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 2ee74aad01..78fc5329c3 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.Warn("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.Warn("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 8e05cb874e..fcaeef977a 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.Warn("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/Install/InstallController.cs b/src/Umbraco.Web.Common/Install/InstallController.cs index dbd0def5e9..e9c8de2a83 100644 --- a/src/Umbraco.Web.Common/Install/InstallController.cs +++ b/src/Umbraco.Web.Common/Install/InstallController.cs @@ -118,7 +118,7 @@ namespace Umbraco.Web.Common.Install if (_reported && _reportedLevel == level) return; _reported = true; _reportedLevel = level; - logger.Warn(typeof(UmbracoInstallApplicationBuilderExtensions), message); + logger.LogWarning(typeof(UmbracoInstallApplicationBuilderExtensions), message); } } } diff --git a/src/Umbraco.Web.Common/Macros/MacroRenderer.cs b/src/Umbraco.Web.Common/Macros/MacroRenderer.cs index 8685c0b8b1..1c0486c778 100644 --- a/src/Umbraco.Web.Common/Macros/MacroRenderer.cs +++ b/src/Umbraco.Web.Common/Macros/MacroRenderer.cs @@ -282,7 +282,7 @@ namespace Umbraco.Web.Macros } catch (Exception e) { - _plogger.Warn(e, "Failed {MsgIn}", msgIn); + _plogger.LogWarning(e, "Failed {MsgIn}", msgIn); var macroErrorEventArgs = new MacroErrorEventArgs { diff --git a/src/Umbraco.Web/CdfLogger.cs b/src/Umbraco.Web/CdfLogger.cs index b8f3ae00db..5c329d89c9 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.Warn(msg); + _logger.LogWarning(msg); } public void Error(string msg, Exception ex) diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index c3eedaab3b..021128d551 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -117,7 +117,7 @@ namespace Umbraco.Web.Editors var userId = await SignInManager.GetVerifiedUserIdAsync(); if (string.IsNullOrWhiteSpace(userId)) { - Logger.Warn("Get2FAProviders :: No verified user found, returning 404"); + Logger.LogWarning("Get2FAProviders :: No verified user found, returning 404"); throw new HttpResponseException(HttpStatusCode.NotFound); } @@ -136,7 +136,7 @@ namespace Umbraco.Web.Editors var userId = await SignInManager.GetVerifiedUserIdAsync(); if (string.IsNullOrWhiteSpace(userId)) { - Logger.Warn("Get2FAProviders :: No verified user found, returning 404"); + Logger.LogWarning("Get2FAProviders :: No verified user found, returning 404"); throw new HttpResponseException(HttpStatusCode.NotFound); } @@ -159,7 +159,7 @@ namespace Umbraco.Web.Editors var userName = await SignInManager.GetVerifiedUserNameAsync(); if (userName == null) { - Logger.Warn("Get2FAProviders :: No verified user found, returning 404"); + Logger.LogWarning("Get2FAProviders :: No verified user found, returning 404"); throw new HttpResponseException(HttpStatusCode.NotFound); } diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index b963871a58..ca5279fe2f 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -175,7 +175,7 @@ namespace Umbraco.Web.Editors var authType = OwinContext.Authentication.GetExternalAuthenticationTypes().FirstOrDefault(x => x.AuthenticationType == loginInfo.Login.LoginProvider); if (authType == null) { - Logger.Warn("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 { @@ -198,7 +198,7 @@ namespace Umbraco.Web.Editors shouldSignIn = autoLinkOptions.OnExternalLogin(user, loginInfo); if (shouldSignIn == false) { - Logger.Warn("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 631403d71f..4267c4327f 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.Warn("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.Warn("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/Logging/OwinLogger.cs b/src/Umbraco.Web/Logging/OwinLogger.cs index 96f02a5347..4d1eeb1e19 100644 --- a/src/Umbraco.Web/Logging/OwinLogger.cs +++ b/src/Umbraco.Web/Logging/OwinLogger.cs @@ -33,7 +33,7 @@ namespace Umbraco.Web.Logging _logger.LogError(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Warning: - _logger.Warn(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.LogWarning(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Information: _logger.Info(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); diff --git a/src/Umbraco.Web/Macros/MacroRenderer.cs b/src/Umbraco.Web/Macros/MacroRenderer.cs index 7f6a1cdbf3..9e9bbcd0e5 100644 --- a/src/Umbraco.Web/Macros/MacroRenderer.cs +++ b/src/Umbraco.Web/Macros/MacroRenderer.cs @@ -280,7 +280,7 @@ namespace Umbraco.Web.Macros } catch (Exception e) { - _plogger.Warn(e, "Failed {MsgIn}", msgIn); + _plogger.LogWarning(e, "Failed {MsgIn}", msgIn); var macroErrorEventArgs = new MacroErrorEventArgs { diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index 7286f52c64..57a1b34892 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.Warn("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 9000e426ac..af74e1da08 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.Warn("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 f13be1c6ea..ffbf5a5b09 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.Warn("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.Warn(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 b099110911..95b2dcda58 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.Warn>("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.Warn>("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/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 5b72e9cda0..78a296ad39 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -455,7 +455,7 @@ namespace Umbraco.Web } catch (Exception ex) when (ex is FormatException || ex is ArgumentException) { - Current.Logger.Warn(typeof(UmbracoHelper), "A value was detected in the ufprt parameter but Umbraco could not decrypt the string"); + Current.Logger.LogWarning(typeof(UmbracoHelper), "A value was detected in the ufprt parameter but Umbraco could not decrypt the string"); parts = null; return false; } diff --git a/src/Umbraco.Web/UmbracoInjectedModule.cs b/src/Umbraco.Web/UmbracoInjectedModule.cs index ecb67c997d..b0510fb4ca 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.Warn("Umbraco has no content"); + _logger.LogWarning("Umbraco has no content"); if (RouteTable.Routes[Constants.Web.NoContentRouteName] is Route route) { diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 2dffe13851..e5b7914626 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.Warn("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 9ef704bb52..1180cbd9d6 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.Warn("The actionExecutedContext is null!!??"); + Current.Logger.LogWarning("The actionExecutedContext is null!!??"); return; } if (actionExecutedContext.Request == null) { - Current.Logger.Warn("The actionExecutedContext.Request is null!!??"); + Current.Logger.LogWarning("The actionExecutedContext.Request is null!!??"); return; } if (actionExecutedContext.Request.Content == null) { - Current.Logger.Warn("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.Warn("The f.TempFilePath is null or whitespace!!??"); + Current.Logger.LogWarning("The f.TempFilePath is null or whitespace!!??"); } } } else { - Current.Logger.Warn("The uploadedFiles.UploadedFiles is null!!??"); + Current.Logger.LogWarning("The uploadedFiles.UploadedFiles is null!!??"); } } else { - Current.Logger.Warn("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.Warn("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()); } } }