- Added and changed some logging level and messages.

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@696 a942ae1a-1317-0410-a47c-b1dcaea8d605
_tent/ipv6_via_aInfo
Cyril Jaquier 2008-05-19 21:05:32 +00:00
parent ad72c8e00e
commit 8da2fe515a
6 changed files with 20 additions and 11 deletions

View File

@ -17,13 +17,13 @@ ver. 0.8.3 (2008/??/??) - stable
- Fixed PID file while started in daemon mode. Thanks to
Christian Jobic who submitted a similar patch.
- Fixed "fail2ban-client get <jail> logpath". Bug #1916986.
- Changed some log levels.
- Added gssftpd filter. Thanks to Kevin Zembower.
- Added "Day/Month/Year Hour:Minute:Second" date template.
Thanks to Dennis Winter.
- Fixed ignoreregex processing in fail2ban-client. Thanks to
René Berber.
- Added ISO 8601 date/time format.
- Added and changed some logging level and messages.
ver. 0.8.2 (2008/03/06) - stable
----------

View File

@ -68,7 +68,7 @@ class Filter(JailThread):
self.dateDetector = DateDetector()
self.dateDetector.addDefaultTemplate()
logSys.info("Created Filter")
logSys.debug("Created Filter")
##

View File

@ -53,7 +53,7 @@ class FilterGamin(FileFilter):
self.__modified = False
# Gamin monitor
self.monitor = gamin.WatchMonitor()
logSys.info("Created FilterGamin")
logSys.debug("Created FilterGamin")
def callback(self, path, event):

View File

@ -54,7 +54,7 @@ class FilterPoll(FileFilter):
## The time of the last modification of the file.
self.__lastModTime = dict()
self.__file404Cnt = dict()
logSys.info("Created FilterPoll")
logSys.debug("Created FilterPoll")
##
# Add a log file path

View File

@ -37,6 +37,7 @@ class Jail:
self.__name = name
self.__queue = Queue.Queue()
self.__filter = None
logSys.info("Creating new jail '%s'" % self.__name)
if backend == "polling":
self.__initPoller()
else:
@ -47,14 +48,14 @@ class Jail:
self.__action = Actions(self)
def __initPoller(self):
logSys.info("Using poller")
logSys.info("Jail '%s' uses poller" % self.__name)
from filterpoll import FilterPoll
self.__filter = FilterPoll(self)
def __initGamin(self):
# Try to import gamin
import gamin
logSys.info("Using Gamin")
logSys.info("Jail '%s' uses Gamin" % self.__name)
from filtergamin import FilterGamin
self.__filter = FilterGamin(self)
@ -82,12 +83,14 @@ class Jail:
def start(self):
self.__filter.start()
self.__action.start()
logSys.info("Jail '%s' started" % self.__name)
def stop(self):
self.__filter.stop()
self.__action.stop()
self.__filter.join()
self.__action.join()
logSys.info("Jail '%s' stopped" % self.__name)
def isAlive(self):
isAlive0 = self.__filter.isAlive()

View File

@ -46,11 +46,11 @@ class Server:
self.__daemon = daemon
self.__transm = Transmitter(self)
self.__asyncServer = AsyncServer(self.__transm)
self.__logLevel = 3
self.__logTarget = "STDOUT"
self.__logLevel = None
self.__logTarget = None
# Set logging level
self.setLogLevel(self.__logLevel)
self.setLogTarget(self.__logTarget)
self.setLogLevel(3)
self.setLogTarget("STDOUT")
def __sigTERMhandler(self, signum, frame):
logSys.debug("Caught signal %d. Exiting" % signum)
@ -66,6 +66,7 @@ class Server:
# First set the mask to only allow access to owner
os.umask(0077)
if self.__daemon:
logSys.info("Starting in daemon mode")
ret = self.__createDaemon()
if ret:
logSys.info("Daemon started")
@ -345,7 +346,6 @@ class Server:
logSys.error("Unable to log to " + target)
logSys.info("Logging to previous target " + self.__logTarget)
return False
self.__logTarget = target
# Removes previous handlers
for handler in logging.getLogger("fail2ban").handlers:
# Closes the handler.
@ -354,6 +354,12 @@ class Server:
# tell the handler to use this format
hdlr.setFormatter(formatter)
logging.getLogger("fail2ban").addHandler(hdlr)
# Does not display this message at startup.
if not self.__logTarget == None:
logSys.info("Changed logging target to %s for Fail2ban v%s" %
(target, version.version))
# Sets the logging target.
self.__logTarget = target
return True
finally:
self.__loggingLock.release()