in main :
handler = RotatingFileHandler('/tmp/mylog')
handler.setLevel(logging.DEBUG)
app.logger.addHandler(handler)
my_glob.logger = app.logger
app.debug = True
app.run(host='0.0.0.0', port=80)
in a 'url' :
import my_glob
...
handling get request here:
logger = my_glob.logger
logger.info('this wont show unless app.debug=True is specified')
logger.error('this always shows up')
if I do this, it works. If I remove app.debug = True, it doesn't work. But flask documentation says that app.debug is on local environments/debugging, not on production. So what should I use to enable logging on info/debug levels ?