[url]http://sas.sparklingstudios.com/articles/2006/08/31/exception-notifier-ruby-on-rails-plugin[/url]
以下是原文:
[quote]
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:
[code]
ruby script/plugin install exception_notification
[/code]
2. Configure exception_notification: Add following line to your config/environment.rb file:
[code]ExceptionNotifier.exception_recipients = %w(your@emailaddress.com)[/code]
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:
[code]
class ApplicationController < ActionController::Base
include ExceptionNotifiable
end
[/code]
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! See[url]http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer[/url]in section “Configuration”.
For advanced configuration read [url]http://dev.rubyonrails.org/browser/plugins/exception_notification/README[/url]
[/quote]
以下是原文:
[quote]
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:
[code]
ruby script/plugin install exception_notification
[/code]
2. Configure exception_notification: Add following line to your config/environment.rb file:
[code]ExceptionNotifier.exception_recipients = %w(your@emailaddress.com)[/code]
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:
[code]
class ApplicationController < ActionController::Base
include ExceptionNotifiable
end
[/code]
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! See[url]http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer[/url]in section “Configuration”.
For advanced configuration read [url]http://dev.rubyonrails.org/browser/plugins/exception_notification/README[/url]
[/quote]