增加接口日志输出

This commit is contained in:
mark.tian
2025-12-02 19:57:54 +08:00
parent 6cb2b9225f
commit addd75fbf9
10 changed files with 1029 additions and 21 deletions

View File

@@ -16,6 +16,14 @@ class Settings(BaseSettings):
external_api_retry_max: int = 4 # 外部API最大重试次数
external_api_url: str = "https://external.com/api/openapi/customerApi/aiTaskResultFail"
# 日志配置
log_level: str = "INFO" # DEBUG, INFO, WARNING, ERROR, CRITICAL
log_file: str = "logs/app.log" # 日志文件路径
log_max_bytes: int = 10 * 1024 * 1024 # 10MB
log_backup_count: int = 5 # 备份文件数量
log_format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
log_date_format: str = "%Y-%m-%d %H:%M:%S"
# 应用配置
app_name: str = "AI Talk Callback API"
debug: bool = False