python - Gunicorn not picking stderr -
i have flask app following route:
@app.route('/') def index(): console = logging.streamhandler() log = logging.getlogger("asdasd") log.addhandler(console) log.setlevel(logging.debug) log.error("something") print >> sys.stderr, "another thing" return 'ok'
i run using
python gunicorn --access-logfile /mnt/log/test.log --error-logfile /mnt/log/test.log --bind 0.0.0.0:8080 --workers 2 --worker-class gevent --log-level debug server:app
the logs below:
2014-06-26 00:13:55 [21621] [info] using worker: gevent 2014-06-26 00:13:55 [21626] [info] booting worker pid: 21626 2014-06-26 00:13:55 [21627] [info] booting worker pid: 21627 2014-06-26 00:14:05 [21626] [debug] / 10.224.67.41 - - [26/jun/2014:00:14:14 +0000] "get / http/1.1" 200 525 "-" "python-requests/2.2.1 cpython/2.7.5 darwin/13.2.0" 2014-06-26 00:14:14 [21626] [debug] closing connection.
what's happening logs in index method?
as of gunicorn 19.0, gunicorn has stopped redirecting stderr logs.
refer https://github.com/benoitc/gunicorn/commit/41523188bc05fcbba840ba2e18ff67cd9df638e9
Comments
Post a Comment