From 39b72dec99fa48f1c000db71a7ef92aecf1b70c9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 20 Feb 2014 18:35:08 -0800 Subject: [PATCH] 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. --- package_cache/main.py | 3 +++ 1 file changed, 3 insertions(+) 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( -- 2.26.2