Created
January 2, 2020 20:40
-
-
Save davidmlentz/976752d5b9bf7781314c9455be438b6b 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
import logging | |
from flask import Flask | |
import time | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
# logHandler = logging.FileHandler('/var/log/myproject/app.log') | |
# logHandler.setLevel(logging.INFO) | |
# app.logger.addHandler(logHandler) | |
app.logger.addHandler(logging.StreamHandler()) | |
app.logger.setLevel(logging.INFO) | |
app.logger.info("INFO message in the log") | |
app.logger.warn("WARN message in the log") | |
#time.sleep(33) | |
return "hi." | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment