[backend][logging] Add structured LoggingInterceptor with pino#572
Open
mc-stephen wants to merge 2 commits into
Open
[backend][logging] Add structured LoggingInterceptor with pino#572mc-stephen wants to merge 2 commits into
mc-stephen wants to merge 2 commits into
Conversation
- 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
Contributor
|
Solid logging interceptor @mc-stephen, exactly the kind of structured-logging we want — merging 🚀 |
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. 🙏 |
Author
Thanks. Conflict fixed, accepted both releases, coming and current. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a structured LoggingInterceptor that emits one structured log line per request using pino.
Changes
src/common/interceptors/logging.interceptor.ts— NestJS interceptor that logsmethod,path,status,duration_ms,user_id, andrequest_idper requestsrc/main.ts— registers the interceptor globally viaapp.useGlobalInterceptors()package.json— addedpinodependencyAcceptance Criteria
Closes #523