Feat/structured json logging#194
Open
whitezaddy wants to merge 3 commits into
Open
Conversation
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.
Pull Request: Refactor Global Logging Architecture to Structured Flat JSON
Closes #176
🚀 Overview
This pull request refactors the API's global logging architecture to output strictly formatted JSON strings instead of raw human-readable console text. This prepares the application environment for high-scale log ingestion, filtering, and metric query aggregation across centralized observability tools like AWS CloudWatch or the ELK stack.
🛠️ Key Changes
nestjs-pinoandpino-httpas the primary global application log interceptors insidesrc/app.module.tsandsrc/main.ts.X-Request-IDheader value directly into the top-level"reqId"attribute field across all nested HTTP lifecycle access logs.src/jobs/indexer.ts) to use Nest's structured logger utility framework.ioredisoption constraints (retryStrategy: null) to prevent unhandled background execution termination loops when testing telemetry behavior in offline decoupled infrastructure scenarios.🧪 Verification & Testing
The application dev pipeline was run locally and verified to stream fully conformant flat telemetry objects.
Example Standardized Standard Out Stream Lines:
{"level":"info","time":"2026-06-29T14:41:55.160Z","pid":18064,"hostname":"WHITE-DESKTOP-T9M3C0D","context":"Bootstrap","msg":"Application is running on: http://localhost:3000"} {"level":"warn","time":"2026-06-29T14:56:55.161Z","pid":18064,"hostname":"WHITE-DESKTOP-T9M3C0D","context":"RedisService","msg":"Redis tracking network offline (Host: localhost:6379). Bypassing telemetry streaming metrics locally."}