diff --git a/ATXCommon/Serializables/ServiceConfig.cs b/ATXCommon/Serializables/ServiceConfig.cs index 81f2d020c43b680eec2a465b1e6ac50f8ab4f5a5..1e8a8f677b1235199d8b79fc36bfb8a34eecdf5e 100644 --- a/ATXCommon/Serializables/ServiceConfig.cs +++ b/ATXCommon/Serializables/ServiceConfig.cs @@ -14,11 +14,9 @@ namespace ATXCommon.Serializables [Serializable] public class ServiceConfig { - [XmlIgnore] public string ValidationWarnings; [XmlIgnore] private static readonly Logger Log = LogManager.GetCurrentClassLogger(); public ServiceConfig() { - ValidationWarnings = ""; // set values for the optional XML elements: SmtpHost = ""; SmtpPort = 25; @@ -252,15 +250,19 @@ namespace ATXCommon.Serializables throw new ConfigurationErrorsException("ServiceTimer must not be smaller than 1000 ms!"); - // NON-CRITICAL stuff just adds messages to ValidationWarnings: - // DestinationDirectory + // NON-CRITICAL stuff is simply reported to the logs: if (!c.DestinationDirectory.StartsWith(@"\\")) { - var msg = "<DestinationDirectory> is not a UNC path!\n"; - c.ValidationWarnings += " - " + msg; - Log.Warn(msg); + ReportNonOptimal("DestinationDirectory", c.DestinationDirectory, "is not a UNC path!"); } } + /// <summary> + /// Print a standardized msg about a non-optimal configuration setting to the log. + /// </summary> + private static void ReportNonOptimal(string attribute, string value, string msg) { + Log.Warn(">>> Non-optimal setting detected: <{0}> [{1}] {2}", attribute, value, msg); + } + public string Summary() { var msg = "HostAlias: " + HostAlias + "\n" + diff --git a/AutoTx/AutoTx.cs b/AutoTx/AutoTx.cs index ed9bdc8fd5cf53af7214f9a725c70abef4d7f3fd..9ec03441327b348ca1631f18ef37ca6b86e0b480 100644 --- a/AutoTx/AutoTx.cs +++ b/AutoTx/AutoTx.cs @@ -309,10 +309,6 @@ namespace AutoTx SendAdminEmail(warn); } - if (!string.IsNullOrEmpty(_config.ValidationWarnings)) { - Log.Warn("WARNING: some configuration settings might not be optimal:\n{0}", - _config.ValidationWarnings); - } if (!string.IsNullOrEmpty(_status.ValidationWarnings)) { Log.Warn("WARNING: some status parameters were invalid and have been reset:\n{0}", _status.ValidationWarnings);