librelist archives

« back to archive

Logging errors in flask

Logging errors in flask

From:
Jose Ayerdis
Date:
2013-01-26 @ 20:26
Hello I have been trying to log on DEBUG mode nevertheless when I run the
app the file is created but nothing is never write nor append to it. My
current configuratoin is this one

import logging
file_handler = logging.FileHandler('kitch.log')
file_handler.setLevel(logging.DEBUG)
 file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s:
%(message)s [in %(pathname)s:%(lineno)d] [%(funcName)s() from %(module)s]'))
app.logger.addHandler(file_handler)

app.run(debug=app.config['DEBUG'])

As you can see is very straight foward, I would expect to get errorrs when
404 or 401 is encounter. Any advice?

Sincerly yours,

[Jose Luis Ayerdis Espinoza]
Necronet.info |
LinkedIn<http://www.linkedin.com/pub/jose-luis-ayerdis-espinoza/28/7b4/704>|
Careers
StackOverflow <http://careers.stackoverflow.com/necronet>