2

I've just setup an nginx server with uWSGI to serve my website which I built in Flask. I now want to setup logging, which I've done like this:

logfileHandler = RotatingFileHandler('/var/log/trs/debug.log', maxBytes=100000, backupCount=10)
logfileHandler.setLevel(logging.DEBUG)
app.logger.addHandler(logfileHandler)

And I then log some things using the following:

current_app.logger.debug('DEBUG LOG')
current_app.logger.info('INFO LOG')
current_app.logger.warning('WARNING LOG')
current_app.logger.error('ERROR LOG')
current_app.logger.critical('CRITICAL LOG')

To my surprise however, I only see the last three logs in the debug.log:

WARNING LOG
ERROR LOG
CRITICAL LOG

Any idea why debug and info are not displaying? All tips are welcome!

kramer65
  • 50,427
  • 120
  • 308
  • 488

0 Answers0