From dd3ab3a0dc9b5998b01ebc7e2183b57d71da8a76 Mon Sep 17 00:00:00 2001 From: Liam Laverty Date: Mon, 22 Jan 2024 01:57:58 +0000 Subject: [PATCH] Temp/15591 serilog string conventions (#15592) * Updaets `MigrationPlanExecutor.cs` to use serilog convention for strings * Updaets `ExamineManagementController.cs` to use serilog convention for strings * Updaets `HelpController.cs` to use serilog convention for strings * Updaets `PreviewAuthenticationMiddleware.cs` to use serilog convention for strings --- src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs | 2 +- .../Controllers/ExamineManagementController.cs | 2 +- src/Umbraco.Web.BackOffice/Controllers/HelpController.cs | 2 +- .../Middleware/PreviewAuthenticationMiddleware.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs b/src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs index faea87bd68..77677b0bfc 100644 --- a/src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs +++ b/src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs @@ -127,7 +127,7 @@ public class MigrationPlanExecutor : IMigrationPlanExecutor continue; } - _logger.LogInformation($"PostMigration: {migrationContextPostMigration.FullName}."); + _logger.LogInformation("PostMigration: {migrationContextFullName}.", migrationContextPostMigration.FullName); MigrationBase postMigration = _migrationBuilder.Build(migrationContextPostMigration, executedMigrationContext); postMigration.Run(); diff --git a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs index d41ccf684e..21cb7fdcd9 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs @@ -306,7 +306,7 @@ public class ExamineManagementController : UmbracoAuthorizedJsonController indexer.IndexOperationComplete -= Indexer_IndexOperationComplete; } - _logger.LogInformation($"Rebuilding index '{indexer?.Name}' done."); + _logger.LogInformation("Rebuilding index '{indexerName}' done.", indexer?.Name); var cacheKey = "temp_indexing_op_" + indexer?.Name; _runtimeCache.Clear(cacheKey); diff --git a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs index 65662d8ca5..da3ac9013f 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs @@ -66,7 +66,7 @@ public class HelpController : UmbracoAuthorizedJsonController } catch (HttpRequestException rex) { - _logger.LogInformation($"Check your network connection, exception: {rex.Message}"); + _logger.LogInformation("Check your network connection, exception: {message}", rex.Message); } return new List(); diff --git a/src/Umbraco.Web.Common/Middleware/PreviewAuthenticationMiddleware.cs b/src/Umbraco.Web.Common/Middleware/PreviewAuthenticationMiddleware.cs index 0748f5cbb4..5bd16867ca 100644 --- a/src/Umbraco.Web.Common/Middleware/PreviewAuthenticationMiddleware.cs +++ b/src/Umbraco.Web.Common/Middleware/PreviewAuthenticationMiddleware.cs @@ -75,7 +75,7 @@ public class PreviewAuthenticationMiddleware : IMiddleware catch (Exception ex) { // log any errors and continue the request without preview - _logger.LogError($"Unable to perform preview authentication: {ex.Message}"); + _logger.LogError("Unable to perform preview authentication: {message}", ex.Message); } finally {