Forum: Ruby on Rails Hook Exist in Rails for System-Wide Exception Logging?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4c1eaa228c74856babe8a895a093a500?d=identicon&s=25 Peter Alvin (remoteportal)
on 2009-02-14 14:29
On our production servers, I'd like all exceptions to be automatically
logged to the database.

In other C# project I wrote that meant putting a try/catch in every
entry point method with the catch calling a generic routine which did
the INSERT into exceptions... SQL statement.

How do I do this in rails?  It would be nice if in application.rb or
even in each controller you could do:

exception_logger :my_exception_logger

Perhaps this could be implemented using filters?  Hopefully rails
already has this exact functionality built-in as I'd imagine everyone
would need it?

Pete
47c3af2d56d44eb1d08a601c837a1262?d=identicon&s=25 alberto (Guest)
on 2009-02-16 06:15
(Received via mailing list)
Rails Exception Notifier will give you what you need. If you want, you
can hook into it a write to the DB, but you will find that the email
notification is plenty.

http://github.com/rails/exception_notification/tree/master
9a2a53db8e9b4476038c94a64b32833f?d=identicon&s=25 Ryan Bigg (ryan-bigg)
on 2009-02-16 06:42
(Received via mailing list)
http://getexceptional.com is pretty good for that kind of thing too.
This topic is locked and can not be replied to.