From abb30bcb332ae11d2e7c788545e82010838d1c19 Mon Sep 17 00:00:00 2001 From: hashjang Date: Sat, 17 May 2025 06:49:55 +0800 Subject: [PATCH] feat: add debug log for request and response (#19781) -- add new ENV (thanks to @laipaz8200) --- api/.env.example | 1 + docker/.env.example | 4 ++++ docker/docker-compose.yaml | 1 + 3 files changed, 6 insertions(+) diff --git a/api/.env.example b/api/.env.example index 3230e3d828..9dec564c28 100644 --- a/api/.env.example +++ b/api/.env.example @@ -348,6 +348,7 @@ SENTRY_DSN= # DEBUG DEBUG=false +ENABLE_REQUEST_LOGGING=False SQLALCHEMY_ECHO=false # Notion import configuration, support public and internal diff --git a/docker/.env.example b/docker/.env.example index 37738a5065..a7c033018d 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -74,6 +74,10 @@ DEBUG=false # which is convenient for debugging. FLASK_DEBUG=false +# Enable request logging, which will log the request and response information. +# And the log level is DEBUG +ENABLE_REQUEST_LOGGING=False + # A secret key that is used for securely signing the session cookie # and encrypting sensitive information on the database. # You can generate a strong key using `openssl rand -base64 42`. diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index bfdfa701e3..0aca3b749e 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -19,6 +19,7 @@ x-shared-env: &shared-api-worker-env LOG_TZ: ${LOG_TZ:-UTC} DEBUG: ${DEBUG:-false} FLASK_DEBUG: ${FLASK_DEBUG:-false} + ENABLE_REQUEST_LOGGING: ${ENABLE_REQUEST_LOGGING:-False} SECRET_KEY: ${SECRET_KEY:-sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U} INIT_PASSWORD: ${INIT_PASSWORD:-} DEPLOY_ENV: ${DEPLOY_ENV:-PRODUCTION}