summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-07-31 08:51:47 +0200
committerAzul <azul@leap.se>2014-07-31 08:51:47 +0200
commit3bd643e182e681a047768583b0c2eb2b34f45a2c (patch)
tree7f3c0bf7f7dec07a9039f29cf6691e18e35a7d45 /config/initializers
parent791033d4a3021cc0a476a514667b17a6d519aa89 (diff)
filter out 404 error traces
They add very little value and clutter the production logs when bots scan.
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/exception_filter.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/initializers/exception_filter.rb b/config/initializers/exception_filter.rb
new file mode 100644
index 0000000..18c74d9
--- /dev/null
+++ b/config/initializers/exception_filter.rb
@@ -0,0 +1,10 @@
+class ActionDispatch::DebugExceptions
+ def log_error_with_exception_filter(env, wrapper)
+ if wrapper.exception.is_a? ActionController::RoutingError
+ return
+ else
+ log_error_without_exception_filter env, wrapper
+ end
+ end
+ alias_method_chain :log_error, :exception_filter
+end