开发者

catch all fatal errors in rails

is there a way to catch all fatal errors on rails - in the controllers or in the view.

So far i tried to do this on application controller:

before_filter :catch_all_errors

def catch_all_errors
 开发者_运维知识库 rescue Exception
  logger.info "Catch exception"
end    

And it doesn't work, the fatal errors generated by rails still ends up on the log file.

Thanks.


I have always used the exception_logger plugin. You will get a small page with all logged exceptions. This is super useful when your site goes online, but you want to know about problems with your app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜