Skip to content

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Oct 11, 2025

Make it possible to silence request logs for health check routes using slog-http filters and a CLI flag for the executables.

  • Parse and wire -silent-healthchecks to skip logs for <prefix>/api/health-checks via IgnorePathPrefix in slog-http
  • Refactor initServer to accept unexported initServerOpts type to handle growing number of params (logger, pathPrefix,
    silentHealthChecks) signature.
  • Document flag in docs/health_checks.md and add guidance for embedded usage.

Fixes #227.

Also, I've bumped to golangci-lint v2.5.0 locally so I'm upgrading the project here to keep it in sync.

Silence request logs for health check routes using slog-http filters.

- Parse and wire `-silent-healthchecks` to skip logs for
  `<prefix>/api/health-checks` via `IgnorePathPrefix` in slog-http
- Refactor `initServer` to accept unexported `initServerOpts` type to
  handle growing number of params (logger, pathPrefix,
  silentHealthChecks)
  signature.
- Document flag in docs/health_checks.md and add guidance for embedded
  usage.

Fixes #227.
@bgentry bgentry requested a review from brandur October 11, 2025 17:46
@bgentry bgentry merged commit 3c6fce9 into master Oct 12, 2025
19 checks passed
@bgentry bgentry deleted the bg-silent-healthchecks-flag branch October 12, 2025 00:30
bgentry added a commit that referenced this pull request Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to disable logs for health checks

3 participants