Skip to content

feat(observability): add pino request logging#248

Open
changliuchang777 wants to merge 1 commit into
StableRoute-Org:mainfrom
changliuchang777:observability/logging-12-pino-correlation
Open

feat(observability): add pino request logging#248
changliuchang777 wants to merge 1 commit into
StableRoute-Org:mainfrom
changliuchang777:observability/logging-12-pino-correlation

Conversation

@changliuchang777

Copy link
Copy Markdown

Summary

  • add a pino-backed src/logger.ts with LOG_LEVEL support and test-mode silence
  • replace the manual console.log(JSON.stringify(...)) request timing log with structured child logger output bound to requestId/method/path
  • log unhandled request errors at error level with request correlation and stack via pino's error serializer, without logging request bodies
  • configure redaction paths for Authorization and X-Api-Key style header fields
  • document LOG_LEVEL and add focused logger tests

Fixes #12

Validation

  • git diff --check passed except Git for Windows LF/CRLF warnings
  • npm test -- --runInBand src/__tests__/logger.test.ts passed
  • npx eslint src/logger.ts src/__tests__/logger.test.ts passed
  • npm test -- --runInBand src/__tests__/errorHandler.test.ts blocked by existing baseline parse error in src/index.ts: duplicate WEBHOOK_MAX_EVENTS
  • npm run build blocked by existing baseline TypeScript errors in src/index.ts and src/__tests__/store.adapter.test.ts
  • npm run lint blocked by existing baseline lint errors unrelated to this change

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.

Add structured logging with pino and request correlation

1 participant