Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

no need for stacktraces in case of routing errors

Markus Kahl1770bbb8ed20
diff --git a/config/initializers/suppress_routing_error_logs.rb b/config/initializers/suppress_routing_error_logs.rb
new file mode 100644
index 00000000000..6c4dd072f1f
--- /dev/null
+++ b/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?