mirror of https://github.com/fail2ban/fail2ban
- Removed date from logging message when using SYSLOG. Thanks to Iain Lea
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@626 a942ae1a-1317-0410-a47c-b1dcaea8d605_tent/ipv6_via_aInfo
parent
c40534123c
commit
c7b099f785
|
@ -18,6 +18,8 @@ ver. 0.8.2 (2007/??/??) - stable
|
||||||
Halchenko. It will be possible to create stronger failregex
|
Halchenko. It will be possible to create stronger failregex
|
||||||
against log injection
|
against log injection
|
||||||
- Fixed ipfw action script. Thanks to Nick Munger
|
- Fixed ipfw action script. Thanks to Nick Munger
|
||||||
|
- Removed date from logging message when using SYSLOG. Thanks
|
||||||
|
to Iain Lea
|
||||||
|
|
||||||
ver. 0.8.1 (2007/08/14) - stable
|
ver. 0.8.1 (2007/08/14) - stable
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -315,7 +315,11 @@ class Server:
|
||||||
def setLogTarget(self, target):
|
def setLogTarget(self, target):
|
||||||
try:
|
try:
|
||||||
self.__loggingLock.acquire()
|
self.__loggingLock.acquire()
|
||||||
|
# set a format which is simpler for console use
|
||||||
|
formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s")
|
||||||
if target == "SYSLOG":
|
if target == "SYSLOG":
|
||||||
|
# Syslog daemons already add date to the message.
|
||||||
|
formatter = logging.Formatter("%(name)-16s: %(levelname)-6s %(message)s")
|
||||||
facility = logging.handlers.SysLogHandler.LOG_DAEMON
|
facility = logging.handlers.SysLogHandler.LOG_DAEMON
|
||||||
hdlr = logging.handlers.SysLogHandler("/dev/log",
|
hdlr = logging.handlers.SysLogHandler("/dev/log",
|
||||||
facility = facility)
|
facility = facility)
|
||||||
|
@ -336,10 +340,8 @@ class Server:
|
||||||
# Removes previous handlers
|
# Removes previous handlers
|
||||||
for handler in logging.getLogger("fail2ban").handlers:
|
for handler in logging.getLogger("fail2ban").handlers:
|
||||||
# Closes the handler.
|
# Closes the handler.
|
||||||
handler.close()
|
|
||||||
logging.getLogger("fail2ban").removeHandler(handler)
|
logging.getLogger("fail2ban").removeHandler(handler)
|
||||||
# set a format which is simpler for console use
|
handler.close()
|
||||||
formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s")
|
|
||||||
# tell the handler to use this format
|
# tell the handler to use this format
|
||||||
hdlr.setFormatter(formatter)
|
hdlr.setFormatter(formatter)
|
||||||
logging.getLogger("fail2ban").addHandler(hdlr)
|
logging.getLogger("fail2ban").addHandler(hdlr)
|
||||||
|
|
Loading…
Reference in New Issue