{"action":"created","issue":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/1124","labels_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1124/labels{/name}","comments_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1124/comments","events_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1124/events","html_url":"https://github.com/benoitc/gunicorn/issues/1124","id":110480217,"number":1124,"title":"Flask app errors logged to stdout, not captured by Gunicorn logging facility","user":{"login":"angstwad","id":1240740,"avatar_url":"https://avatars.githubusercontent.com/u/1240740?v=3","gravatar_id":"","url":"https://api.github.com/users/angstwad","html_url":"https://github.com/angstwad","followers_url":"https://api.github.com/users/angstwad/followers","following_url":"https://api.github.com/users/angstwad/following{/other_user}","gists_url":"https://api.github.com/users/angstwad/gists{/gist_id}","starred_url":"https://api.github.com/users/angstwad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angstwad/subscriptions","organizations_url":"https://api.github.com/users/angstwad/orgs","repos_url":"https://api.github.com/users/angstwad/repos","events_url":"https://api.github.com/users/angstwad/events{/privacy}","received_events_url":"https://api.github.com/users/angstwad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-08T15:48:53Z","updated_at":"2015-10-08T18:56:15Z","closed_at":null,"body":"What had previously worked for us had suddenly stopped working.  Running Flask 0.10.1 (and Flask-Restful) and Gunicorn 19.3.0, we set up a warning stream handler for errors.  These errors were previously captured by Gunicorn, but were instead logging out to the Gunicorn process' stdout/stderr, instead of being captured to the access and error logs (which were and always have been configured).\r\n\r\nIn order to resolve this issue, we had to add the `gunicorn.error` logging facilities to the Flask app's handlers.  Here's a snippet where we setup and then extend Flask's handlers in order to achieve \"normal\" logging by Gunicorn:\r\n\r\n```\r\nhandler = logging.StreamHandler()\r\nhandler.setLevel(logging.WARNING)\r\napp.logger.addHandler(handler)\r\n# fix gives access to the gunicorn error log facility\r\napp.logger.handlers.extend(logging.getLogger(\"gunicorn.error\").handlers)\r\n```"},"comment":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/comments/146653807","html_url":"https://github.com/benoitc/gunicorn/issues/1124#issuecomment-146653807","issue_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1124","id":146653807,"user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T18:56:15Z","updated_at":"2015-10-08T18:56:15Z","body":"Oh, this was not a Gunicorn version update?"}}