Created
April 30, 2016 06:04
-
-
Save seanbehan/547f5fc599bde304c89694a98c102bab to your computer and use it in GitHub Desktop.
logging on heroku with flask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
from flask import Flask | |
app = Flask(__name__) | |
app.logger.addHandler(logging.StreamHandler(sys.stdout)) | |
app.logger.setLevel(logging.ERROR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can make this more universal by selectively enabling the sys out logger if a Heroku environment is detected.