no need for stacktraces in case of routing errors

pull/8164/head
Markus Kahl 5 years ago
parent b31a28bb7f
commit 1770bbb8ed
  1. 15
      config/initializers/suppress_routing_error_logs.rb

@ -0,0 +1,15 @@
module NoRoutingErrorLogging
def log_error(env, wrapper)
super unless ignore_error?(env, wrapper)
end
def ignore_error?(env, wrapper)
!Rails.logger.debug? && routing_error?(env, wrapper)
end
def routing_error?(_env, wrapper)
wrapper.exception.is_a? ActionController::RoutingError
end
end
ActionDispatch::DebugExceptions.prepend NoRoutingErrorLogging if Rails.env.production?
Loading…
Cancel
Save