ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.25k stars 531 forks source link

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

Open rahul-rocket opened 9 hours ago

rahul-rocket commented 9 hours ago

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.)
  3. 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

rahul-rocket commented 2 hours ago

DB Structure PR #8390