Skip to content

Commit 65db610

Browse files
committed
print error logs on stderr and access logs on stdout
fix #1184
1 parent 5fa32a6 commit 65db610

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

gunicorn/glogging.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,29 @@
5252
"root": {"level": "INFO", "handlers": ["console"]},
5353
"gunicorn.error": {
5454
"level": "INFO",
55-
"handlers": ["console"],
55+
"handlers": ["error_console"],
5656
"propagate": True,
5757
"qualname": "gunicorn.error"
58+
},
59+
60+
"gunicorn.access": {
61+
"level": "INFO",
62+
"handlers": ["console"],
63+
"propagate": True,
64+
"qualname": "gunicorn.access"
5865
}
5966
},
6067
handlers={
6168
"console": {
6269
"class": "logging.StreamHandler",
6370
"formatter": "generic",
6471
"stream": "sys.stdout"
65-
}
72+
},
73+
"error_console": {
74+
"class": "logging.StreamHandler",
75+
"formatter": "generic",
76+
"stream": "sys.stderr"
77+
},
6678
},
6779
formatters={
6880
"generic": {

0 commit comments

Comments
 (0)