From: <los...@us...> - 2008-05-19 21:05:47
|
Revision: 696 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=696&view=rev Author: lostcontrol Date: 2008-05-19 14:05:32 -0700 (Mon, 19 May 2008) Log Message: ----------- - Added and changed some logging level and messages. Modified Paths: -------------- branches/FAIL2BAN-0_8/ChangeLog branches/FAIL2BAN-0_8/server/filter.py branches/FAIL2BAN-0_8/server/filtergamin.py branches/FAIL2BAN-0_8/server/filterpoll.py branches/FAIL2BAN-0_8/server/jail.py branches/FAIL2BAN-0_8/server/server.py Modified: branches/FAIL2BAN-0_8/ChangeLog =================================================================== --- branches/FAIL2BAN-0_8/ChangeLog 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/ChangeLog 2008-05-19 21:05:32 UTC (rev 696) @@ -17,13 +17,13 @@ - 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 ---------- Modified: branches/FAIL2BAN-0_8/server/filter.py =================================================================== --- branches/FAIL2BAN-0_8/server/filter.py 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/server/filter.py 2008-05-19 21:05:32 UTC (rev 696) @@ -68,7 +68,7 @@ self.dateDetector = DateDetector() self.dateDetector.addDefaultTemplate() - logSys.info("Created Filter") + logSys.debug("Created Filter") ## Modified: branches/FAIL2BAN-0_8/server/filtergamin.py =================================================================== --- branches/FAIL2BAN-0_8/server/filtergamin.py 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/server/filtergamin.py 2008-05-19 21:05:32 UTC (rev 696) @@ -53,7 +53,7 @@ self.__modified = False # Gamin monitor self.monitor = gamin.WatchMonitor() - logSys.info("Created FilterGamin") + logSys.debug("Created FilterGamin") def callback(self, path, event): Modified: branches/FAIL2BAN-0_8/server/filterpoll.py =================================================================== --- branches/FAIL2BAN-0_8/server/filterpoll.py 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/server/filterpoll.py 2008-05-19 21:05:32 UTC (rev 696) @@ -54,7 +54,7 @@ ## 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 Modified: branches/FAIL2BAN-0_8/server/jail.py =================================================================== --- branches/FAIL2BAN-0_8/server/jail.py 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/server/jail.py 2008-05-19 21:05:32 UTC (rev 696) @@ -37,6 +37,7 @@ 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 @@ 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 @@ 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() Modified: branches/FAIL2BAN-0_8/server/server.py =================================================================== --- branches/FAIL2BAN-0_8/server/server.py 2008-05-18 20:08:34 UTC (rev 695) +++ branches/FAIL2BAN-0_8/server/server.py 2008-05-19 21:05:32 UTC (rev 696) @@ -46,11 +46,11 @@ 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 @@ # 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 @@ 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 @@ # 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() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |