Skip to content
Snippets Groups Projects
Commit 4d623b5b authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Move call to SetupMailLogging to LoadConfig

That's the earliest place where setting up the mail logger is possible /
makes sense, so do it right then. Additionally, the check for SmtpHost
is redundant since it also done in the method called, so no need for it.
parent c4c8a356
No related branches found
No related tags found
No related merge requests found
......@@ -285,7 +285,10 @@ namespace ATxService
// this should terminate the service process:
throw new Exception("Error loading configuration.");
}
// update the file logger with the configured log level:
SetupFileLogging(_config.LogLevel);
// the mail logger requires the configuration to be present, so we can call it now:
SetupMailLogging();
}
/// <summary>
......@@ -311,10 +314,6 @@ namespace ATxService
/// Check if loaded configuration is valid, print a summary to the log.
/// </summary>
private void CheckConfiguration() {
// non-critical / optional configuration parameters:
if (!string.IsNullOrWhiteSpace(_config.SmtpHost))
SetupMailLogging();
var configInvalid = false;
if (FsUtils.CheckSpoolingDirectories(_config.IncomingPath, _config.ManagedPath) == false) {
Log.Error("ERROR checking spooling directories (incoming / managed)!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment