diff --git a/common/__init__.py b/common/__init__.py index 2b76f4b6d..3eae8ee36 100644 --- a/common/__init__.py +++ b/common/__init__.py @@ -23,3 +23,8 @@ __author__ = "Cyril Jaquier" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" + +import logging + +# Custom debug level +logging.HEAVYDEBUG = 5 diff --git a/fail2ban-testcases b/fail2ban-testcases index 0bd70259a..fc5cc1462 100755 --- a/fail2ban-testcases +++ b/fail2ban-testcases @@ -52,7 +52,7 @@ def get_opt_parser(): p.add_options([ Option('-l', "--log-level", type="choice", dest="log_level", - choices=('debug', 'info', 'warn', 'error', 'fatal'), + choices=('heavydebug', 'debug', 'info', 'warning', 'error', 'fatal'), default=None, help="Log level for the logger to use during running tests"), Option('-n', "--no-network", action="store_true", @@ -76,7 +76,8 @@ parser = get_opt_parser() logSys = logging.getLogger("fail2ban") # Numerical level of verbosity corresponding to a log "level" -verbosity = {'debug': 3, +verbosity = {'heavydebug': 4, + 'debug': 3, 'info': 2, 'warn': 1, 'error': 1, diff --git a/server/filter.py b/server/filter.py index 90530f923..59e612ede 100644 --- a/server/filter.py +++ b/server/filter.py @@ -291,6 +291,8 @@ class Filter(JailThread): except UnicodeDecodeError: l = line l = l.rstrip('\r\n') + + logSys.log(5, "Working on line %r", l) timeMatch = self.dateDetector.matchTime(l) if timeMatch: # Lets split into time part and log part of the line @@ -355,6 +357,8 @@ class Filter(JailThread): if failRegex.hasMatched(): # The failregex matched. date = self.dateDetector.getUnixTime(timeLine) + logSys.log(7, "Date: %r, message: %r", + timeLine, logLine) if date is None: logSys.debug("Found a match for %r but no valid date/time " "found for %r. Please file a detailed issue on"