diff --git a/config/fail2ban.conf.default b/config/fail2ban.conf.default index bbdce173..45f063a7 100644 --- a/config/fail2ban.conf.default +++ b/config/fail2ban.conf.default @@ -19,9 +19,9 @@ debug = false # Option: logtargets # Notes.: log targets. Space separated list of logging targets. -# Values: STDOUT STDERR SYSLOG file Default: STDOUT /var/log/fail2ban.log +# Values: STDERR SYSLOG file Default: /var/log/fail2ban.log # -logtargets = STDOUT /var/log/fail2ban.log +logtargets = /var/log/fail2ban.log # Option: pidlock # Notes.: path of the PID lock file (must be able to write to file). diff --git a/confreader/configreader.py b/confreader/configreader.py index e413103b..150858b5 100644 --- a/confreader/configreader.py +++ b/confreader/configreader.py @@ -24,12 +24,12 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import log4py +import logging from ConfigParser import * -# Gets the instance of log4py. -logSys = log4py.Logger().get_instance() +# Gets the instance of the logger. +logSys = logging.getLogger("fail2ban") class ConfigReader: """ This class allow the handling of the configuration options. diff --git a/firewall/firewall.py b/firewall/firewall.py index 9b072c78..b0da3826 100644 --- a/firewall/firewall.py +++ b/firewall/firewall.py @@ -24,13 +24,13 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import time, os, log4py, re +import time, os, logging, re from utils.process import executeCmd from utils.strings import replaceTag -# Gets the instance of log4py. -logSys = log4py.Logger().get_instance() +# Gets the instance of the logger. +logSys = logging.getLogger("fail2ban") class Firewall: """ Manages the ban list and executes the command that ban diff --git a/logreader/logreader.py b/logreader/logreader.py index e96dc903..0dea9d70 100644 --- a/logreader/logreader.py +++ b/logreader/logreader.py @@ -24,12 +24,12 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import os, sys, time, re, log4py +import os, sys, time, re, logging from utils.dns import * -# Gets the instance of log4py. -logSys = log4py.Logger().get_instance() +# Gets the instance of the logger. +logSys = logging.getLogger("fail2ban") class LogReader: """ Reads a log file and reports information about IP that make password diff --git a/utils/mail.py b/utils/mail.py index aab02b4e..5781d89e 100644 --- a/utils/mail.py +++ b/utils/mail.py @@ -24,12 +24,12 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import log4py, smtplib +import logging, smtplib from utils.strings import replaceTag -# Gets the instance of log4py. -logSys = log4py.Logger().get_instance() +# Gets the instance of the logger. +logSys = logging.getLogger("fail2ban") class Mail: """ Mailer class diff --git a/utils/strings.py b/utils/strings.py index ae0108d2..6ed7ece8 100644 --- a/utils/strings.py +++ b/utils/strings.py @@ -24,10 +24,10 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import log4py +import logging -# Gets the instance of log4py. -logSys = log4py.Logger().get_instance() +# Gets the instance of the logger. +logSys = logging.getLogger("fail2ban") def replaceTag(query, aInfo): """ Replace tags in query