开发者

catch all fatal errors in rails

开发者 https://www.devze.com 2023-02-07 01:32 出处:网络
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:

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

精彩评论

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