#! /bin/sh /usr/share/dpatch/dpatch-run ## 00_close_log.dpatch by Yaroslav Halchenko ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: post release patches @DPATCH@ diff -urNad fail2ban~/server/server.py fail2ban/server/server.py --- fail2ban~/server/server.py 2007-11-06 14:26:10.000000000 -0500 +++ fail2ban/server/server.py 2007-11-06 14:33:46.000000000 -0500 @@ -314,12 +314,17 @@ else: # Target should be a file try: - open(target, "a") + open(target, "a").close() hdlr = logging.FileHandler(target) except IOError: logSys.error("Unable to log to " + target) return False self.__logTarget = target + # Removes previous handlers + for handler in logging.getLogger("fail2ban").handlers: + # Closes the handler. + handler.close() + logging.getLogger("fail2ban").removeHandler(handler) # set a format which is simpler for console use formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s") # tell the handler to use this format