views:

24

answers:

1

is there a python middleware that captures errors from web app and emails it? which is the easiest one to use.

i am deploying app using nginx proxying to multiple app servers of gunicorn+web.py framework. right now any error is printed out in each app server, which is not very easy to manage.

what is the best way to handle this?

+1  A: 

Check out Paste. Code to email an exception would look something like:

from paste.exceptions.errormiddleware import ErrorMiddleware
app = ErrorMiddleware(app,
                      global_conf, debug=False,
                      error_email='[email protected]',
                      smtp_server='localhost')
Hollister