Links
Exception Notifier
Categories
Exception Notifier
The Exception Notifier plugin provides a mailer object and a default set of templates for sending email notifications when errors occur in a Rails application. The plugin is configurable, allowing programmers to specify:
- the sender address of the email
- the recipient addresses
- the text used to prefix the subject line
The email includes information about the current request, session, and environment, and also gives a backtrace of the exception.
Vitals
| Home | http://github.com/rails/exception_notification/tree/master |
|---|---|
| Repository | git://github.com/rails/exception_notification.git |
| License | Rails' (MIT) |
| Tags |
abcd ballsack email error exception exception helped_me_a_alot log mailer nbnb Notifier notify performance pretty_cool rail stack stacktrace trace
|
| Rating | (123 votes) |
| Created | 18 May 2006 |
Comments
-
This seems to break on Rails 1.2:
I keep getting the following error message: Expected /Users/aselder/BostonLogic/match/config/../vendor/plugins/exceptionnotification/lib/exceptionnotifier.rb to define ExceptionNotifier
-
Same problem with Rails 1.2 this article (http://www.mathewabonyi.com/articles/2007/02/18/initial-reactions-to-rails-12-annoyed/) talks about it, but does not really offer a solution
-
You can get an updated version of this that should work with Rails 1.2 from the Caboo.se sample app.
http://sample.caboo.se/
-
Thanks for a highly useful plugin.
I'm using Rails 1.2.3 and the plugin works just fine.
-
Note, this plugin hooks into ActionController::rescueactionin_public()
If you're working in your development environment or on your local machine, this won't be called and the plugin won't send e-mail.
If you want to just try this out, throw this line at the bottom of app/controllers/application.rb:
alias :rescueactionlocally :rescueactionin_public
Assume you can send mail and you configured the plugin, voila! It works in development.
-
In ruby 1.8.6p111, rendering the _environment.rhtml plugin fails with "TemplateError: flag after width". This is fixed if you change the string "%-s" to "%-s" on line three of the template.
-
This is the correct string: "%-*s:"
-
To test under development mode, add alias :rescueactionlocally :rescueactionin_public in your ApplicationController (don't know why the underscore dissapear when copy-pasted!)
-
I was having trouble with it in a project, and found this: http://dev.rubyonrails.org/ticket/9940
Then it began working for me!
-
I keep getting a warning starting up my rails application warning: already initialized constant VIEW_PATH warning: already initialized constant APP_PATH warning: already initialized constant PARAMFILTERREPLACEMENT
It started when I moved my app from 1.1.6 to 1.2.3.
-
Hello.
For the life of me, I cannot get the Exception Notification plugin to send email when in development mode. When tracing with the debugger it seems that no exception handlers are regsitered [rescue.rb: if rescueactionwithhandler(exception)]. As a result, ExceptionNotifiable.rescueaction_in_public never executes.
If you have any thoughts, I'd love to hear them.
NOTES
- I'm running Rails 2.0.2
- I've restarted Webrick several times
- for testing purposes, I'm forcing rails to throw a NameError exception
- I know ActionMailer has been setup properly as I can send mail through it.
[environment.rb]
Rails::Initializer.run do |config| config.actioncontroller.considerallrequestslocal = false end
ExceptionNotifier.exception_recipients = %w(u...@website.com) ExceptionNotifier.sender_address = %w(serv...@website.com)
[application.rb]
class ApplicationController < ActionController::Base include ExceptionNotifiable local_addresses.clear end
-
I recently upgraded my app to rail 2.1 . I was running it in 1.2.3 all while.
I hit this error: ActionView::TemplateFinder::InvalidViewPath (Unprocessed view path found: ... vendor/plugins/exception_notification/lib/../views"
Has any faced this? How do I solve it?
Thanks in Advance, Sandeep G
-
Sandeep: I'm having the exact same problem. Anyone have a solution?
-
This seems to get it going again in 2.1.
In ExceptionNotifiable there is a templateroot method. Change "def templateroot" to "self.template_root =", and remove the "end".
Sorry to be so elliptical, but this comment system obviously eats Ruby syntax for breakfast... :)
-
I'm seeing the same problem as reported by Sandeep, can't seem to get it fixed. Any help appreciated. Thanks.
-
To fix this plugin for rails 2.1 go to class ExceptionNotifier, comment out the template root function and add templateroot= "#{File.dirname(FILE)}/../views" as the first line of the exceptionnotification function.
-
Must have plugin for applications that were recently deployed and could have some bugs ;)
-
Just installed the latest on GIT in Rails 2.2.2. This seems to break setting exceptionrecipients in production.rb, as it appears the vendor plugins get loaded after production.rb is processed and the require 'reinitializes' the ExceptionNotifier class a second time (resulting in the exceptionrecipients being reinitialized). A Workaround is to configure exception_notifier in a file in the initializers directory, but I'd be interested in knowing what the 'right' way to do this. (Rails 2.2.2/OSX 10.5)

