From e714c47016d3f8678c05ec970a640ad6758bd096 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Fri, 9 Mar 2018 13:50:07 +0100
Subject: [PATCH] Adjust log levels when checking processes and free space.

This way an email will be sent to an admin if configured so they have a
chance to check what's going on.
---
 ATxCommon/SystemChecks.cs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ATxCommon/SystemChecks.cs b/ATxCommon/SystemChecks.cs
index 1fa1c74..0fc8b2f 100644
--- a/ATxCommon/SystemChecks.cs
+++ b/ATxCommon/SystemChecks.cs
@@ -66,7 +66,9 @@ namespace ATxCommon
                 return dInfo.TotalFreeSpace;
             }
             catch (Exception ex) {
-                Log.Warn("Error in GetFreeDriveSpace({0}): {1}", drive, ex.Message);
+                // log this as an error which then also gets sent via email (if configured) and
+                // let the rate-limiter take care of not flooding the admin with mails:
+                Log.Error("Error in GetFreeDriveSpace({0}): {1}", drive, ex.Message);
             }
 
             return 0;
@@ -109,7 +111,7 @@ namespace ATxCommon
                     }
                 }
                 catch (Exception ex) {
-                    Log.Warn("Error in checkProcesses(): {0}", ex.Message);
+                    Log.Error("Error in checkProcesses(): {0}", ex.Message);
                 }
             }
 
-- 
GitLab