Skip to content

Commit

Permalink
Redirect application log to stderr, which is picked up by gunicorn. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
coleslaw authored and mistercrunch committed Apr 20, 2016
1 parent 17e711f commit efc6bf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caravel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

app = Flask(__name__)
app.config.from_object(CONFIG_MODULE)
if not app.debug:
# In production mode, add log handler to sys.stderr.
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)

db = SQLA(app)

cache = Cache(app, config=app.config.get('CACHE_CONFIG'))
Expand Down

0 comments on commit efc6bf4

Please sign in to comment.