Hello, I''d like to know how I can suppress errors in the logs for routing errors for missing files. For instance, something like this: [ERROR] application#index (ActionController::RoutingError) "no route found to match \"/release/record_cover/192/small/646.jpg\" with {:method=>:get}" This is because a file is missing that is referenced on the page. We have other methods to catch this and it is just cluttering up the Rails log (and sending a ton of exception emails!) so I''d like to disable them. These are being reported at log level ''info''. Thanks, Hunter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hunter Hillegas wrote:> Hello, > > I''d like to know how I can suppress errors in the logs for routing > errors for missing files. > > For instance, something like this: > > [ERROR] application#index (ActionController::RoutingError) "no route > found to match \"/release/record_cover/192/small/646.jpg\" with > {:method=>:get}" > > This is because a file is missing that is referenced on the page. We > have other methods to catch this and it is just cluttering up theWhat are these other methods? You could have rescue_action_in_public(exception) check ActionController::UnknownController === exception || ActionController::UnknownAction === exception and produce an error page, and have your own logging message (or none if preferred). Stephan> Rails log (and sending a ton of exception emails!) so I''d like to > disable them. > > These are being reported at log level ''info''. > > Thanks, > Hunter-- 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 -~----------~----~----~----~------~----~------~--~---
Stephan Wehner wrote:> Hunter Hillegas wrote: >> Hello, >> >> I''d like to know how I can suppress errors in the logs for routing >> errors for missing files. >> >> For instance, something like this: >> >> [ERROR] application#index (ActionController::RoutingError) "no route >> found to match \"/release/record_cover/192/small/646.jpg\" with >> {:method=>:get}" >> >> This is because a file is missing that is referenced on the page. We >> have other methods to catch this and it is just cluttering up the > > What are these other methods? > > You could have rescue_action_in_public(exception) check > > ActionController::UnknownController === exception || > ActionController::UnknownAction === exceptionI forgot -- plus, set the last entry in config/routes.rb like this. map.catchall ''*all'', :controller => ''some_controller'', :action => ''not_found'' with this not_found method in your "some_controller" def not_found log_info("Page not found: #{request.env[''REQUEST_URI'']}") @page_title = "Page not found" render :action => ''no_such_page'', :layout=>''external'', :status => 404 end The not_found rhtml gives useful error information, as usual. But you seem to have your own method, that''s why I asked. Stephan> > and produce an error page, and have your own logging message (or none if > preferred). > > Stephan > >> Rails log (and sending a ton of exception emails!) so I''d like to >> disable them. >> >> These are being reported at log level ''info''. >> >> Thanks, >> Hunter-- 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 -~----------~----~----~----~------~----~------~--~---