BF/ENH: include [PID] into logging msgs, remove indentation from syslog messages

Otherwise leads to incorrect parsing of the log messages by syslog(-ng). See
http://bugs.debian.org/730202

I also removed %(levelname)-6s from syslog messages completely since they are
passed to the syslog and it is up to the configuration/admin to decide include
levels into the messages or not (I have checked that at least debug level indeed
goes to /var/log/debug)
pull/451/merge^2
Yaroslav Halchenko 11 years ago
parent 28d8aec511
commit d34d8db3d2

@ -347,13 +347,12 @@ class Server:
try:
self.__loggingLock.acquire()
# set a format which is simpler for console use
formatter = logging.Formatter("%(asctime)s %(name)-16s: %(levelname)-6s %(message)s")
formatter = logging.Formatter("%(name)s[%(process)d]: %(levelname)-7s %(message)s")
if target == "SYSLOG":
# Syslog daemons already add date to the message.
formatter = logging.Formatter("%(name)-16s: %(levelname)-6s %(message)s")
formatter = logging.Formatter("%(name)s[%(process)d]: %(message)s")
facility = logging.handlers.SysLogHandler.LOG_DAEMON
hdlr = logging.handlers.SysLogHandler("/dev/log",
facility = facility)
hdlr = logging.handlers.SysLogHandler("/dev/log", facility=facility)
elif target == "STDOUT":
hdlr = logging.StreamHandler(sys.stdout)
elif target == "STDERR":

Loading…
Cancel
Save