From cab0764713bc05393a7ec9740427e387948cf018 Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Thu, 31 Mar 2022 18:34:04 +0200 Subject: [PATCH] Add ignore for logging 404s --- config/initializers/lograge.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index e0dbc6a..07decf9 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -15,4 +15,9 @@ params: event.payload[:params].except(*exceptions), } end + + config.lograge.ignore_custom = lambda do |event| + # If 404 is raised, it's a routing error and should be ignored + event.payload[:status] == 404 + end end