开发者

python middleware to capture errors?

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?


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='foo@example.com',
                      smtp_server='localhost')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜