Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Silence healthcheck requests in lograge#831

Merged
lfdebrux merged 1 commit intomainfrom
ldeb-lograge-ignore-health-controller
Sep 26, 2025
Merged

Silence healthcheck requests in lograge#831
lfdebrux merged 1 commit intomainfrom
ldeb-lograge-ignore-health-controller

Conversation

@lfdebrux
Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

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.

I've tested this in dev.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

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]: govuk-forms/forms-deploy#1720
@lfdebrux lfdebrux force-pushed the ldeb-lograge-ignore-health-controller branch from ccea01d to f6d7ae3 Compare September 26, 2025 09:53
@lfdebrux lfdebrux enabled auto-merge September 26, 2025 09:53
@sonarqubecloud
Copy link
Copy Markdown

@lfdebrux lfdebrux merged commit 267237a into main Sep 26, 2025
4 checks passed
@lfdebrux lfdebrux deleted the ldeb-lograge-ignore-health-controller branch September 26, 2025 09:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants