Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get gunicorn to log uncaught exceptions?

I have a flask application wrapped with gunicorn. I would like that if one of my endpoints exits with an uncaught exception that somewhere the exception is logged. I don't want this going to the client however, just a server logfile.

like image 805
edA-qa mort-ora-y Avatar asked Jan 28 '14 08:01

edA-qa mort-ora-y


1 Answers

Config Flask PROPAGATE_EXCEPTIONS to True. This will enable propagation of exceptions, and gunicorn will log a logfile.

http://flask.pocoo.org/docs/config/#builtin-configuration-values

like image 92
Jan Zhen Avatar answered Oct 06 '22 19:10

Jan Zhen