Skip to content

[backend][logging] Add structured LoggingInterceptor with pino#572

Open
mc-stephen wants to merge 2 commits into
Gatheraa:mainfrom
mc-stephen:fix/structured-logger-middleware
Open

[backend][logging] Add structured LoggingInterceptor with pino#572
mc-stephen wants to merge 2 commits into
Gatheraa:mainfrom
mc-stephen:fix/structured-logger-middleware

Conversation

@mc-stephen

Copy link
Copy Markdown

Summary

Adds a structured LoggingInterceptor that emits one structured log line per request using pino.

Changes

  • New: src/common/interceptors/logging.interceptor.ts — NestJS interceptor that logs method, path, status, duration_ms, user_id, and request_id per request
  • Modified: src/main.ts — registers the interceptor globally via app.useGlobalInterceptors()
  • Modified: package.json — added pino dependency

Acceptance Criteria

  • LoggingInterceptor emits one structured log per request: method, path, status, duration_ms, user_id, request_id
  • Uses pino as the underlying logger
  • Log lines parse as level=info fields=...

Closes #523

- Creates LoggingInterceptor that emits one structured log line per request
- Logs: method, path, status, duration_ms, user_id, request_id
- Uses pino as the structured logger
- Registers globally in main.ts

Closes Gatheraa#523

Copy link
Copy Markdown
Contributor

Solid logging interceptor @mc-stephen, exactly the kind of structured-logging we want — merging 🚀

Copy link
Copy Markdown
Contributor

@mc-stephen — quick follow-up: tried to merge but there are real merge conflicts against main now (other PRs landed first). Could you rebase onto main and I'll merge on the next push. 🙏

@mc-stephen

Copy link
Copy Markdown
Author

Solid logging interceptor @mc-stephen, exactly the kind of structured-logging we want — merging 🚀

Thanks.

Conflict fixed, accepted both releases, coming and current.
nothing breaks.

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.

[backend][logging] No structured logger middleware

2 participants