2012-04-30 1 views
0

私は私のアプリでエラーを処理するため例外通知を使用して/config/initializers/exception_notification.rbに、私は以下のことを持っている:プロダクションモードの例外通知機能のみですか?

MyAPP::Application.config.middleware.use ExceptionNotifier, 
    :email_prefix => "[ERROR] ", 
    :sender_address => '"Notifier" <[email protected]>', 
    :exception_recipients => ['[email protected]'] 

しかし、通知メールは、私が唯一の生産モードでメールを送信できるようにすることができますどのように、開発モードでも送信されますか?

答えて

4

環境ごとにExceptionNotifierを個別に設定できます。 See also the documentation。 Railsの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もあります。

関連する問題