欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Exception Notifier - Ruby on Rails plugin RailsRubyUP 

程序员文章站 2022-07-09 20:43:04
...
http://sas.sparklingstudios.com/articles/2006/08/31/exception-notifier-ruby-on-rails-plugin

以下是原文:
引用

Yesterday I came over Exception Notifier.

I found it really useful because it is really easy to install and you can instantly react to Application Errors. Your customers don’t have to notify you because you get a bunch of information to track the error via email.

3 easy steps are necessary to set up Exception Notifier:
1. Install the exception_notification plugin:
ruby script/plugin install exception_notification

2. Configure exception_notification: Add following line to your config/environment.rb file:
ExceptionNotifier.exception_recipients = %w(your@emailaddress.com)

3. Tell the Exception Notifier for which controller it shoud send exception notifications to you. In this example it will send notifications for all exceptions:
class ApplicationController < ActionController::Base
    include ExceptionNotifiable 
end

Thats it! Now you will be notified when an error rises.

NOTE: If your server can’t send mails, you have to configure your Rails app for sending mails! Seehttp://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailerin section “Configuration”.
For advanced configuration read http://dev.rubyonrails.org/browser/plugins/exception_notification/README
相关标签: Rails Ruby UP