王筝的博客
ruby学习

https://github.com/smartinez87/exception_notification#sections

 

Add the following line to your application’s Gemfile:

gem 'exception_notification'

As of Rails 3 ExceptionNotification is used as a rack middleware, or in the environment you want it to run. In most cases you would want ExceptionNotification to run on production. Thus, you can make it work by putting the following lines in your config/environments/production.rb:
Whatever::Application.config.middleware.use ExceptionNotification::Rack,
  :email => {
    :email_prefix => "[Whatever] ",
    :sender_address => %{"notifier" <notifier@example.com>},
    :exception_recipients => %w{exceptions@example.com}
  }

31 Cms::Application.config.middleware.use ExceptionNotifier,
32 :email_prefix => “[CMS Error] “,
33 :sender_address => %{#{Settings.notifier.full_email}},
34 :exception_recipients => %w{wangzheng@111.com}