From f6d7ae346ec33585ce44f02650b4111f867f50b5 Mon Sep 17 00:00:00 2001 From: Laurence de Bruxelles Date: Tue, 23 Sep 2025 08:53:00 +0300 Subject: [PATCH] Silence healthcheck requests in lograge Since Rails 8, the health check controller logs are filtered out from the log stream by default [[1]]. All our apps are now using Rails 8 and have `config.silence_healthcheck_path` enabled [[2]], so we stopped filtering out log lines containing `/up` in our log forwarding configuration [[3]]. However, this doesn't appear to have worked, as we are now seeing logs from the healthcheck controller. This is probably because of how Lograge works; this commit adds an additional configuration line to tell Lograge to ignore logs for the healthcheck controller, matching the Rails default. [1]: rails/rails#52789 [2]: https://guides.rubyonrails.org/configuring.html#config-silence-healthcheck-path [3]: https://github.com/alphagov/forms-deploy/pull/1720 --- config/environments/production.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index c10bff55..cd3778f0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -44,6 +44,7 @@ # Prevent health checks from clogging up the logs. config.silence_healthcheck_path = "/up" + config.lograge.ignore_actions = "Rails::HealthController#show" # Don't log any deprecations. config.active_support.report_deprecations = false