[Feature] Add logging parameters and error output to terminal (#7098)

This commit is contained in:
zhouchong
2026-04-01 13:18:42 +08:00
committed by GitHub
parent af51fc46d6
commit 91c832f607
10 changed files with 404 additions and 14 deletions
+15
View File
@@ -15,9 +15,24 @@ environment_variables: dict[str, Callable[[], Any]] = {
# Log directory
"FD_LOG_DIR": lambda: os.getenv("FD_LOG_DIR", "log"),
# Global log level, prefer this over FD_DEBUG. Supports "INFO" and "DEBUG".
"FD_LOG_LEVEL": lambda: os.getenv("FD_LOG_LEVEL", None),
# Enable debug mode (0 or 1)
"FD_DEBUG": lambda: int(os.getenv("FD_DEBUG", "0")),
# Request logging master switch. Set to 0 to disable request logging.
"FD_LOG_REQUESTS": lambda: int(os.getenv("FD_LOG_REQUESTS", "1")),
# Request logging detail level (0-3). Higher level means more verbose output.
"FD_LOG_REQUESTS_LEVEL": lambda: int(os.getenv("FD_LOG_REQUESTS_LEVEL", "0")),
# Max field length for request logging truncation.
"FD_LOG_MAX_LEN": lambda: int(os.getenv("FD_LOG_MAX_LEN", "2048")),
# Unified trace mode: off, local, otel, all.
"FD_TRACE": lambda: os.getenv("FD_TRACE", "off"),
# FastDeploy log retention days
"FD_LOG_BACKUP_COUNT": lambda: os.getenv("FD_LOG_BACKUP_COUNT", "7"),