Created
March 2, 2015 21:06
-
-
Save ThrowsException/d427b872f9e8a3979b4c to your computer and use it in GitHub Desktop.
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
def create_app(config_settings=None): | |
app = Flask(__name__) | |
file_handler = RotatingFileHandler('app.log') | |
file_handler.setFormatter(Formatter( | |
'%(asctime)s %(levelname)s: %(message)s ' | |
'[in %(pathname)s:%(lineno)d]' | |
)) | |
file_handler.setLevel(logging.DEBUG) | |
app.logger.addHandler(file_handler) | |
# without this line I don't get any log | |
# statements written to my file when | |
# using current_app.logger.info("") | |
# in my blueprint | |
app.logger.setLevel(logging.DEBUG) | |
app.register_blueprint(frontend) | |
return app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment