From: Greg Hauptmann Date: 2007-03-22T10:24:53+09:00 Subject: Ruby best practice re handling system exceptions/application errors/audit events? ------=_Part_120608_5179669.1174526692143 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, What is Ruby best practice re handling system exceptions/application errors/audit events? (mostly for usage with Rails, but also for general Ruby apps). How do Ruby developers normally handle the following categories of event?: a) Uncaught exceptions (i.e. bubble up to top) - Usage: System failure / developer can't do anything - Approach: Let exception bubble to the top - Logging: How? Rails: Ensure rails exception framework will issue a "logger.error" message to the logs? - Alerting: Alert (SMS/Email) based on trigger from an uncaught exception. Rails: Use of "exception_notification" plugin perhaps. b) Trapped exceptions (i.e. handle explicitly) - Usage: Understood application error (not system error) / Developer can offer value add - Approach: Catch and handle hence no exception flows up? - Logging: Rails: Issue a "logger.error" line - Alerting: Hook into the application's exception framework. Rails: How to hook into "exception_notification" plugin? c) Application Specific Audit - Usage: For application specific event (e.g. sale has occurred) and want an email alert and a log entry . - Logging: Via use of application logging facility. Rails: Use of "logger.info" system - Alerting: Use of application alerting system. Rails: Use of "exception_notification" plugin somehow? Any comments / ideas / best practice suggestions would be appreciated. Cheers Greg ------=_Part_120608_5179669.1174526692143--