feat(logger): add HTTP request/response logging fields#2450
feat(logger): add HTTP request/response logging fields#2450AdaAibaby wants to merge 6 commits intoe2b-dev:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f4f807c07
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@AdaAibaby could you add motivation for this? I don't see the methods used anywhere |
@jakubno Thanks for the feedback! You're right that these methods aren't used yet in the current codebase. Motivation and Context: These functions ( While not integrated yet, they're designed for use in HTTP middleware or handlers (e.g., in logger.Info("Request processed",
request_fields.WithRequestID(r),
request_fields.WithRemoteIP(r),
request_fields.WithAPIError("INTERNAL_ERROR", "upstream failure"),
) |
Summary
Add structured HTTP request/response logging fields to the logger package.
This PR introduces reusable zap logger fields for standard HTTP metadata:
All functions are fully covered by unit tests.
Changes
request_fields.go– HTTP logging field functionsrequest_fields_test.go– comprehensive test suiteTesting