From: W. Trevor King Date: Fri, 21 Feb 2014 02:35:08 +0000 (-0800) Subject: main: Add the logger name and process ID to the syslog formatter X-Git-Tag: v0.1~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=39b72dec99fa48f1c000db71a7ef92aecf1b70c9;p=package-cache.git main: Add the logger name and process ID to the syslog formatter When logging to stderr, there's no need to differentiate the logging process. When everything's landing in the same system log, there is. --- diff --git a/package_cache/main.py b/package_cache/main.py index 9daabdb..6d5895c 100644 --- a/package_cache/main.py +++ b/package_cache/main.py @@ -82,6 +82,9 @@ def run(*args, **kwargs): handler = _logging_handlers.SysLogHandler( address='/dev/log', facility='daemon') _MAIN_LOG.addHandler(handler) + formatter = _logging.Formatter( + fmt='%(name)s[%(process)d]: %(message)s') + handler.setFormatter(formatter) server = _server.Server(sources=args.source or [], cache=args.cache) wsgi = _wsgiref_simple_server.make_server(