Skip to content

feat(backend): add request-id-scoped child logging (#368) - #496

Open
Awosdot wants to merge 8 commits into
Stellar-Search:mainfrom
Awosdot:feature/request-id-logging
Open

feat(backend): add request-id-scoped child logging (#368)#496
Awosdot wants to merge 8 commits into
Stellar-Search:mainfrom
Awosdot:feature/request-id-logging

Conversation

@Awosdot

@Awosdot Awosdot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Implemented request-ID-scoped child logging across the backend HTTP request pipeline to ensure every log entry generated during a request lifecycle automatically carries a unique correlation ID (requestId).

Changes Included
Added requestIdMiddleware to extract existing X-Request-ID headers or generate a fallback UUID for incoming requests.

Attached a scoped child logger (req.log) containing requestId context to the HTTP request object.

Ensured X-Request-ID is attached to response headers for end-to-end request tracing.

Replaced direct global logging calls in request handlers/controllers with contextual child logger calls.

Testing
Ran unit/integration test suites (npm test) to confirm no breaking changes.

Verified via manual HTTP requests (curl) that generated log outputs correctly contain the requestId property.

Closes #368

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.

Cross-cutting: Read-model donation totals are inflated by the historical double-counting bug and need reconciliation from the event stream

2 participants