# Exception notification plugin not working in production

**URL:** <https://www.ruby-forum.com/t/exception-notification-plugin-not-working-in-production/131069>\
**Category:** Rails\
**Created:** [March 5, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/exception-notification-plugin-not-working-in-production/131069 "2008-03-05T19:47:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 5, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/exception-notification-plugin-not-working-in-production/131069/1 "2008-03-05T19:47:46Z")

</div>

Hello all,

I am using Rails 2.0.2 and the plugin Exception notification. Contrary  
to all i haven’t got any problem to get it work and send me errors  
notification in development, but i do in production. Of course i have  
disabled all the tricks to make it work in development before  
deploying.  
The mailer is well configured because i do receive email for other  
actions … so i simply don’t get it.

Do i need, after plugin installation to move the exception\_notifier.rb  
file (mailer) to the lib or model directory, in production ? I don’t  
think so because i don’t do that in development and it works

Someone could help me plz ?

---

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 6, 2008, 9:11am UTC](https://www.ruby-forum.com/t/exception-notification-plugin-not-working-in-production/131069/2 "2008-03-06T09:11:10Z")

</div>

On 05 Mar 2008, at 19:47, Gilles wrote:

> think so because i don’t do that in development and it works
> 
> Someone could help me plz ?

My guess is Rails sees the request as a local request. Does the user  
get a stack trace or the Rails error page?

For example, I haven’t found out yet (haven’t really looked for it  
too) why Apache with load balancing makes Rails think all requests  
from the local network (192.168.xx.xx) should be considered as a  
local request, requests from out of that network make Exception  
Notifier send the mails out. Very weird. IIRC, a setup with my  
patched Pound balancer (search google for my rimuhosting forum post  
on that matter) makes Rails behave normally, only real localhost  
requests are considered as such.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 6, 2008, 9:25am UTC](https://www.ruby-forum.com/t/exception-notification-plugin-not-working-in-production/131069/3 "2008-03-06T09:25:16Z")

</div>

I just put the following into config/initializers/notify\_exceptions.rb:

ExceptionNotifier.exception\_recipients = %w(removed\_email\_address@domain.invalid)  
ExceptionNotifier.email\_prefix = "[MYDOMAIN] "  
ExceptionNotifier.sender\_address = %(“Application Error”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid))

and make sure you have the following in environments/production.rb

config.action\_controller.consider\_all\_requests\_local = false

and in ApplicationController:

include ExceptionNotifiable

# remove any consider\_local lines

Does the ExceptionNotifier mail message show up in your logfile? Does  
your server mail.log file display any attempt to deliver the message?
