Commit fcef7d89 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gateway: log autoban errors consistently

parent 76508069
...@@ -11,6 +11,7 @@ import ipaddress ...@@ -11,6 +11,7 @@ import ipaddress
import threading import threading
import re import re
import queue import queue
import logging
from autoban_manager import AutoBanManager from autoban_manager import AutoBanManager
path_to_config = '/etc/eterban/settings.ini' path_to_config = '/etc/eterban/settings.ini'
...@@ -307,6 +308,18 @@ def log_redis_error(message): ...@@ -307,6 +308,18 @@ def log_redis_error(message):
log.flush() log.flush()
def configure_autoban_logging():
autoban_log = logging.getLogger('autoban_manager')
autoban_log.setLevel(logging.ERROR)
autoban_log.propagate = False
handler = logging.StreamHandler(log)
handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
autoban_log.addHandler(handler)
configure_autoban_logging()
conntrack_queue = queue.Queue(maxsize=1024) conntrack_queue = queue.Queue(maxsize=1024)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment