Join the contributor Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
logger.info calls across sorobanService.ts, eventIndexer.ts, and controllers do not consistently include the requestId. The middleware sets req.requestId and runWithRequestContext exists in utils/requestContext.ts, but many call sites bypass it. As a result, production tracing fails to correlate a user request to its downstream DB and RPC calls.
Acceptance criteria
Files to touch
backend/src/utils/logger.ts
backend/src/utils/requestContext.ts
backend/src/controllers/*.ts (incremental)
backend/src/services/*.ts (incremental)
backend/src/__tests__/requestId.test.ts
Out of scope
- Switching to OpenTelemetry tracing (separate, larger effort).
- Replacing winston with pino.
Join the contributor Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
logger.infocalls acrosssorobanService.ts,eventIndexer.ts, and controllers do not consistently include therequestId. The middleware setsreq.requestIdandrunWithRequestContextexists inutils/requestContext.ts, but many call sites bypass it. As a result, production tracing fails to correlate a user request to its downstream DB and RPC calls.Acceptance criteria
logger.info|warn|errorcall sites and ensure they go through a helper that pullsrequestIdfromAsyncLocalStorage.logger.withContext()helper that auto-mergesrequestId,userId, andloanIdif present.x-request-idmatches the logged value.Files to touch
backend/src/utils/logger.tsbackend/src/utils/requestContext.tsbackend/src/controllers/*.ts(incremental)backend/src/services/*.ts(incremental)backend/src/__tests__/requestId.test.tsOut of scope