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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg
2009-Feb-16 05:41 UTC
Re: Hook Exist in Rails for System-Wide Exception Logging?
http://getexceptional.com is pretty good for that kind of thing too. On 16/02/2009, at 3:14 PM, alberto wrote:> > 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 > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---