Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emails to admin on errors? #82

Open
jluttine opened this issue Jun 28, 2018 · 3 comments
Open

Emails to admin on errors? #82

jluttine opened this issue Jun 28, 2018 · 3 comments
Labels
enhancement It's not a bug, but it could be a feature PR-welcome I'm not going to work on this, but you can!

Comments

@jluttine
Copy link

Is there some built-in/correct way of sending an email to the admin if an error occurs on some handler? Occasionally, there are bugs in my handlers that raise exceptions. Then, the email ends up in undeliverable queue. I won't notice it and I won't know the email wasn't delivered. I'd like to get an email notification like "An exception was raised on your Salmon handler foobar". Is there some easy convenient way to achieve this? Or is there some better way to handle this problem altogether?

@moggers87
Copy link
Owner

You can define your own handlers for Python's logging module and get it to send you an email on every error, but that would easily flood your inbox with error messages.

For example, Inboxen.org receives nearly 1000 times more mail than it receives website visitors. If our database went down, we'd get maybe 20 error message emails from Django but Salmon would produce something like 1000 error messages. That's a good way to perform a denial of service attack on yourself!

If you don't want to manually check salmon's error log yourself, you could always try logwatch (available in most distributions)

@moggers87
Copy link
Owner

Having said all that, I'm open to a PR to implement such a logging handler. Just as long as it's not the default.

@moggers87 moggers87 added enhancement It's not a bug, but it could be a feature PR-welcome I'm not going to work on this, but you can! labels Jul 3, 2018
@jluttine
Copy link
Author

jluttine commented Jul 4, 2018

Thanks for the comments! For now, I just handled that specific error case in my code by sending an email back to the sender with an error message. This works for my purposes now. But perhaps some solution based on logs would be better and more generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement It's not a bug, but it could be a feature PR-welcome I'm not going to work on this, but you can!
Projects
None yet
Development

No branches or pull requests

2 participants