We need to create a global logging system that captures and stores all incoming requests and responses for the Time Tracking APIs, ensuring we store endpoint information, headers, and correlation details (CorrelationId). This will allow us to trace and debug issues effectively.
Store routing information for all incoming requests.
Log all request and response details for time tracking APIs.
Create a global logging table in the database that captures this data.
Key Objectives:
Table Name: api_call_log
Data to capture:
Request URL
HTTP Method
Headers (request and response)
Request Body
Response Body
Status Code
Timestamps (request/response times)
CorrelationId
Routing Information (path, method, etc.)
Requirements:
Implement NestJS middleware to intercept all requests/responses.
Ensure sensitive data (e.g., passwords) is excluded from logging.
Add configuration to enable/disable logging per environment.
Review and extend any existing logging logic (e.g., Winston, Morgan, nestjs-cls) to avoid duplication.
Ensure compatibility with existing logging solutions (like JITSU).
Description:
We need to create a global logging system that captures and stores all incoming requests and responses for the Time Tracking APIs, ensuring we store endpoint information, headers, and correlation details (CorrelationId). This will allow us to trace and debug issues effectively.
Key Objectives:
api_call_log
https://github.com/jnm733/nestjs-logger