Send mail on mayor ruby on rails error exceptions
質問
Is there a gem or way to send a mail with action mailer to a predefined admin@myhost.ltd ? I have been looking for some gems to handle exceptions and notify me when a production app has serious issues turndowns or other major failures.
Would like to be notified by email in those cases, Anyone can recommend me a good GEM to handle this ?
解決
Maybe you can try this[1]
I never used, but can work for you
他のヒント
There are some notification tools like Airbrake that can help you with this, but the easy solution is to just add a rescue_from
to your main controller to capture them.
Just be sure that your rescue method doesn't try and rescue its own exceptions.
For those that do want to go commercial, one with really useful email notifications for exceptions (including daily error summary/aggregate email options) is Raygun - it has a ruby gem available at https://rubygems.org/gems/raygun4ruby.