From 457427a5f40953eba62db18345e4ee4a51226beb Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 28 May 2019 10:58:47 +0200 Subject: [PATCH] Cleanup logging in DataTypeMigration --- .../Upgrade/V_8_0_0/DataTypeMigration.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs index 034c7d27ed..438b02385b 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs @@ -70,14 +70,16 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 var newAlias = migrator.GetNewAlias(dataType.EditorAlias); if (newAlias == null) { - _logger.Warn($"Skipping validation of configuration for data type {dataType.NodeId} : {dataType.EditorAlias}." - + $" Please ensure that the configuration is valid. The site may fail to start and / or load data types and run."); + _logger.Warn("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); } else if (!_propertyEditors.TryGet(newAlias, out var propertyEditor)) { - _logger.Warn($"Skipping validation of configuration for data type {dataType.NodeId} : {newAlias}{(dataType.EditorAlias == newAlias ? "" : $" ({dataType.EditorAlias})")}" - + $" because no property editor with alias {newAlias} was found." - + $" Please ensure that the configuration is valid. The site may fail to start and / or load data types and run."); + _logger.Warn("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); } else { @@ -88,8 +90,9 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception e) { - _logger.Warn($"Failed to validate configuration for data type {dataType.NodeId} : {newAlias}{(dataType.EditorAlias == newAlias ? "" : $" ({dataType.EditorAlias})")}." - + $" Please fix the configuration and ensure it is valid. The site may fail to start and / or load data types and run."); + _logger.Warn(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); } }