I\'m new to flask, and I\'m trying to add print info to debug server side code. When launch my flask app with debug=True, i can\'t get any info print to console
I tr
you can use the app instance in development mode besause the logging level is set to DEBUG
app.logger.info('This is info output')
in production mode you need to use a more sever level or you can set the logging level to DEBUG
from flask import Flask
import logging
app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG)
@app.route('/')
def hello_world():
app.logger.info('Processing default request')
return 'Hello World!'
if __name__ == '__main__':
app.run()
this article talk about logging into flask https://www.scalyr.com/blog/getting-started-quickly-with-flask-logging/