ruby : Exception Notification

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}
}

-------------------------------

 30
31 Cms::Application.config.middleware.use ExceptionNotifier,
32 :email_prefix => "[CMS Error] ",
33 :sender_address => %{#{Settings.notifier.full_email}},
34 :exception_recipients => %w{aaa@w.com aaa@w.com}
上一篇:ETHERNET数据包格式( IP & UDP & ICMP & ARP )


下一篇:Web墨卡托投影(转)