Skip to content

Commit

Permalink
log errors to stderr for uwsgi logs to pick up
Browse files Browse the repository at this point in the history
ref #11
  • Loading branch information
davidism committed May 28, 2016
1 parent 102a56f commit c5d36ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sopy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import logging

import sys
from flask import Flask
from flask import render_template
from flask_alembic import Alembic
Expand Down Expand Up @@ -65,4 +68,9 @@ def not_found(e):
def internal_server_error(e):
return render_template('errors/500.html'), 500

if not app.debug:
handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.ERROR)
app.logger.addHander(handler)

return app

0 comments on commit c5d36ce

Please sign in to comment.