feat(logging): enhance logging configuration to support environment variable override for log level

This commit is contained in:
Titan 2026-04-07 10:04:17 +08:00
parent 0f607441c8
commit 6b900ccb60
1 changed files with 4 additions and 2 deletions

View File

@ -23,9 +23,11 @@ from app.gateway.routers import (
) )
from deerflow.config.app_config import get_app_config from deerflow.config.app_config import get_app_config
# Configure logging # Configure logging with env override
import os
log_level = os.environ.get("LOG_LEVEL", "INFO").upper()
logging.basicConfig( logging.basicConfig(
level=logging.INFO, level=getattr(logging, log_level, logging.INFO),
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S", datefmt="%Y-%m-%d %H:%M:%S",
) )