Skip to content

Comments

Add request logging middleware and update setup order#121

Merged
cgalibern merged 2 commits intoopensvc:mainfrom
cgalibern:dev
Feb 22, 2026
Merged

Add request logging middleware and update setup order#121
cgalibern merged 2 commits intoopensvc:mainfrom
cgalibern:dev

Conversation

@cgalibern
Copy link
Contributor

Summary

  • Introduced LogRequestMiddleware to enable structured logging of HTTP requests.
  • Added log.request configuration flag to control logging behavior (default: false).
  • Enhanced logging keys (logkey) with HTTP-specific fields like Method, URI, RemoteIP, and StatusCode.
  • Reordered metricsRegister initialization to ensure consistency with middleware setup.

- Introduced `LogRequestMiddleware` for structured logging of incoming requests using slog.
- Added `log.request` configuration flag with a default value of `false`.
- Extended `logkey` with structured keys for HTTP requests, including `Method`, `URI`, `RemoteIP`, and `StatusCode`.
@cgalibern cgalibern merged commit c5249d2 into opensvc:main Feb 22, 2026
2 checks passed
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.

1 participant