Objective: Replace all console.log and basic error handling with a structured, JSON-based logging system that correlates requests across services. This touches every major file to inject the logger and standardizes output formats.
Files involved (9):
utils/structuredLogger.js (New: The core JSON logging engine)
middleware/requestCorrelation.js (New: Generates unique Trace IDs)
utils/telemetryExporter.js (New: Buffers logs for external export)
middleware/httpLogger.js (New: standardized request/response logging)
routes/telemetry.js (New: API to view internal system health)
server.js
(Update: Global integration)
services/validationEngine.js
(Update: Refactor to use new logger)
jobs/logRotator.js (New: Background log file management)
LOGGING_ARCHITECTURE.md (Technical spec)
Objective: Replace all console.log and basic error handling with a structured, JSON-based logging system that correlates requests across services. This touches every major file to inject the logger and standardizes output formats.
Files involved (9):
utils/structuredLogger.js (New: The core JSON logging engine)
middleware/requestCorrelation.js (New: Generates unique Trace IDs)
utils/telemetryExporter.js (New: Buffers logs for external export)
middleware/httpLogger.js (New: standardized request/response logging)
routes/telemetry.js (New: API to view internal system health)
server.js
(Update: Global integration)
services/validationEngine.js
(Update: Refactor to use new logger)
jobs/logRotator.js (New: Background log file management)
LOGGING_ARCHITECTURE.md (Technical spec)