Created
September 21, 2015 11:20
-
-
Save benjiao/953c426267a80167c2fa to your computer and use it in GitHub Desktop.
Flask Logging to File Example
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
# Setup Logging | |
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s') | |
fh = logging.FileHandler(filename='flask-tutorial.log') | |
fh.setFormatter(formatter) | |
fh.setLevel(logging.DEBUG) | |
app.logger.addHandler(fh) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment