[uWSGI] Feature request: email on worker init exceptions, i.e. "Internal server error"

Igor Katson igor.katson at gmail.com
Tue Oct 15 08:10:25 CEST 2013


Awesome! Thanks, guys. Both solutions are acceptable and solve the issue.
I already wrapped the script in a "try: except" clause (sending the email
in "except"), but the alarm subsystem is also very useful, didn't know of
that.


On Mon, Oct 14, 2013 at 9:24 PM, Roberto De Ioris <roberto at unbit.it> wrote:

>
> > Hi,
> >
> > there's a very nice feature in e.g. Django, when an unhandled exception
> > occurs, the users defined in settings.ADMINS get an email with full
> > stacktrace.
> >
> > When an app cannot be loaded in uwsgi due to any reason, the user just
> > sees
> > "Internal server error".
> > But in many cases, the only way, that I know of, for the admin to see,
> > that
> > the site is actually down, is to receive a complaint from the user. This
> > way is obviously not the most preferred.
> >
> > Is it possible to make uwsgi send an email to a set of predefined
> > addresses
> > on load errors, or, possibly, any other critical errors?
> >
> > Regards,
> > Igor Katson.
> > _______________________________________________
> > uWSGI mailing list
> > uWSGI at lists.unbit.it
> > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
> >
>
> You could use the alarm framework as the error message when apps cannot be
> loaded is always the same:
>
> http://uwsgi-docs.readthedocs.org/en/latest/AlarmSubsystem.html
>
> [uwsgi]
> alarm = mailme cmd:mail -s 'uWSGI alarm' -a 'From: foobar at example.com'
> admin at example.com
> log-alarm = mailme unable to load app
>
>
> getting the stack trace is not its job but you can then check it from the
> logs
>
> --
> Roberto De Ioris
> http://unbit.it
> _______________________________________________
> uWSGI mailing list
> uWSGI at lists.unbit.it
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20131014/99c0c72f/attachment-0001.html>


More information about the uWSGI mailing list