I’m trying to set up a means to automatically send an email from certain parts of troubled code, that is, very often, code that might appear in the Rescue predicate of a begin…rescue, so as to track down issues remotely.
Surely there must be a gem for such? If not, how might one construct something like this in code? TIA, RVic
E-Mail poses a security risk and information leak issue, perhaps try
using a service that offers SSL and make sure to strip information as
it goes into it. There is HoneyBadger (I don't remember them offering
a free service) and Airbrake (they do offer a limited free account.)
There is also bugsnag but I haven't really played with them even
though for some reason they keep emailing me.
The hosted services are a good first pick - if you need something like them but can’t (for security or political reasons) use a third-party service, I’d recommend trying out Errbit:
Direct-to-email stuff (like the old exception_notification plugin) is usually sub-optimal: you’ll wind up getting a lot of repeated emails if your site sees reasonable traffic, making it hard to pick out unique errors. The services / tools above all can send emails, but they default to only notifying you about “new” errors.