From 65da15327eb31f766f1b24be4d0190d67c572942 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 22 Aug 2019 21:17:45 +0200 Subject: [PATCH] curtail some bothering continuously repeatable debug messages of filters (backend-related) to level 4 (below extra heavy-debug, so simplifying debugging and testing with level 5) --- fail2ban/server/filtergamin.py | 2 +- fail2ban/server/filterpoll.py | 8 ++++---- fail2ban/server/filterpyinotify.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fail2ban/server/filtergamin.py b/fail2ban/server/filtergamin.py index 963c6850..77c81757 100644 --- a/fail2ban/server/filtergamin.py +++ b/fail2ban/server/filtergamin.py @@ -64,7 +64,7 @@ class FilterGamin(FileFilter): logSys.debug("Created FilterGamin") def callback(self, path, event): - logSys.debug("Got event: " + repr(event) + " for " + path) + logSys.log(4, "Got event: " + repr(event) + " for " + path) if event in (gamin.GAMCreated, gamin.GAMChanged, gamin.GAMExists): logSys.debug("File changed: " + path) self.__modified = True diff --git a/fail2ban/server/filterpoll.py b/fail2ban/server/filterpoll.py index 30241d50..228a2c8b 100644 --- a/fail2ban/server/filterpoll.py +++ b/fail2ban/server/filterpoll.py @@ -98,8 +98,8 @@ class FilterPoll(FileFilter): def run(self): while self.active: try: - if logSys.getEffectiveLevel() <= 6: - logSys.log(6, "Woke up idle=%s with %d files monitored", + if logSys.getEffectiveLevel() <= 4: + logSys.log(4, "Woke up idle=%s with %d files monitored", self.idle, self.getLogCount()) if self.idle: if not Utils.wait_for(lambda: not self.active or not self.idle, @@ -140,10 +140,10 @@ class FilterPoll(FileFilter): logStats = os.stat(filename) stats = logStats.st_mtime, logStats.st_ino, logStats.st_size pstats = self.__prevStats.get(filename, (0)) - if logSys.getEffectiveLevel() <= 5: + if logSys.getEffectiveLevel() <= 4: # we do not want to waste time on strftime etc if not necessary dt = logStats.st_mtime - pstats[0] - logSys.log(5, "Checking %s for being modified. Previous/current stats: %s / %s. dt: %s", + logSys.log(4, "Checking %s for being modified. Previous/current stats: %s / %s. dt: %s", filename, pstats, stats, dt) # os.system("stat %s | grep Modify" % filename) self.__file404Cnt[filename] = 0 diff --git a/fail2ban/server/filterpyinotify.py b/fail2ban/server/filterpyinotify.py index 383e67a4..ca6b253f 100644 --- a/fail2ban/server/filterpyinotify.py +++ b/fail2ban/server/filterpyinotify.py @@ -87,7 +87,7 @@ class FilterPyinotify(FileFilter): logSys.debug("Created FilterPyinotify") def callback(self, event, origin=''): - logSys.log(7, "[%s] %sCallback for Event: %s", self.jailName, origin, event) + logSys.log(4, "[%s] %sCallback for Event: %s", self.jailName, origin, event) path = event.pathname # check watching of this path: isWF = False