ever-co/ever-gauzy

[Feature] Global Logging for Time Tracking API Requests and Responses

Closed this issue · 1 comments

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.

  1. Store routing information for all incoming requests.
  2. Log all request and response details for time tracking APIs.
  3. Create a global logging table in the database that captures this data.

Key Objectives:

  1. Table Name: api_call_log
  2. 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.)
  1. 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).

https://github.com/jnm733/nestjs-logger

DB Structure PR #8390