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
kim-pham-airbnb committed Apr 13, 2016
1 parent af417b6 commit a0c28e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caravel/__init__.py
Expand Up @@ -22,6 +22,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 a0c28e6

Please sign in to comment.