From: James Edward Gray II Date: 2007-03-27T03:11:57+09:00 Subject: Re: How to handle "System Exceptions" vs "Application Errors" vs "Audit Events" in a Rails App??? On Mar 21, 2007, at 6:48 AM, Greg Hauptmann wrote: > Hi all, Hello. > Just trying to cement by understanding of how to handle system > exceptions/application errors/audit events for a Ruby on Rails > application. > How do people personally handle the following categories of events. I'll add my personal opinions. > a) Uncaught exceptions (i.e. bubble up to top) At my company, we use this option: > - Alerting: Use of "exception_notification" plugin. I highly recommend it. In fact, have this in place very early in development. I often fix bugs using the information it provides, before the client can even email me to report it. ;) > b) Trapped exceptions (i.e. handle explicitly) > - Usage: Understood application error (not system error) > / Developer can offer value add > - Logging: Issue a "logger.error" line > - Alerting: How to hook into "exception_notification" > plugin? I'm not sure I understand the question here. If you trapped the error, you need to deal with it as make sense. That includes recording it, if that's useful information, and giving the user a helpful error message. > c) Application Specific Audit > - Usage: For application specific event (e.g. sale > has occurred) and want an email alert and log it too. > - Logging: Via use of "logger.info" system (? or need > custom solution for audit logging?) > - Alerting: How to hook into "exception_notification" > plugin from this point? This sounds like a great candidate for a before_filter. If you place all the controllers you wish to monitor in a hierarchy, you can set the filter on the parent controller and add whatever handling is appropriate. Hope this helps. James Edward Gray II