diff options
author | Steven Hiscocks <steven@hiscocks.me.uk> | 2014-06-10 20:58:57 +0100 |
---|---|---|
committer | Steven Hiscocks <steven@hiscocks.me.uk> | 2014-06-10 20:58:57 +0100 |
commit | 664f1db0ba77a6be6e020f5fb2d4e7f5a4af0b14 (patch) | |
tree | e5e2bd13c6cf9ff6e4bdb28779f7c0b6cbc4a4e8 /fail2ban/helpers.py | |
parent | 9764c78415e7776c0cffdd306e29180336ef9f35 (diff) | |
download | fail2ban-664f1db0ba77a6be6e020f5fb2d4e7f5a4af0b14.tar.gz |
BF: Fix getLogger for single level log level names
Diffstat (limited to 'fail2ban/helpers.py')
-rw-r--r-- | fail2ban/helpers.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py index 7ba8a72a..cecd3f31 100644 --- a/fail2ban/helpers.py +++ b/fail2ban/helpers.py @@ -111,7 +111,9 @@ class FormatterWithTraceBack(logging.Formatter): def getLogger(name): """Get logging.Logger instance with Fail2Ban logger name convention """ - return logging.getLogger("fail2ban.%s" % name.rpartition(".")[-1]) + if "." in name: + name = "fail2ban.%s" % name.rpartition(".")[-1] + return logging.getLogger(name) def excepthook(exctype, value, traceback): """Except hook used to log unhandled exceptions to Fail2Ban log |