From 65db610afea4c764eb8493b0d96353d468071152 Mon Sep 17 00:00:00 2001 From: benoitc Date: Mon, 2 May 2016 15:26:15 +0200 Subject: [PATCH] print error logs on stderr and access logs on stdout fix #1184 --- gunicorn/glogging.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index 671a589ad..e26175fc3 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -52,9 +52,16 @@ "root": {"level": "INFO", "handlers": ["console"]}, "gunicorn.error": { "level": "INFO", - "handlers": ["console"], + "handlers": ["error_console"], "propagate": True, "qualname": "gunicorn.error" + }, + + "gunicorn.access": { + "level": "INFO", + "handlers": ["console"], + "propagate": True, + "qualname": "gunicorn.access" } }, handlers={ @@ -62,7 +69,12 @@ "class": "logging.StreamHandler", "formatter": "generic", "stream": "sys.stdout" - } + }, + "error_console": { + "class": "logging.StreamHandler", + "formatter": "generic", + "stream": "sys.stderr" + }, }, formatters={ "generic": {