2012-04-30 47 views

回答

4

您可以为每个环境单独配置ExceptionNotifier。 See also the documentation

铁轨3 ExceptionNotification被用作机架中间件,所以 您可以在config.ru文件来配置其选项,或者在 环境中,你希望它运行。在大多数情况下,您希望 ExceptionNotification在生产环境中运行。

因此,您只需在您的config/environments/production.rb中用例如

Whatever::Application.config.middleware.use ExceptionNotifier, 
    :email_prefix => "[Whatever] ", 
    :sender_address => %{"notifier" <[email protected]>}, 
    :exception_recipients => %w{[email protected]} 

还有a nice blog entry handling this topic

相关问题