feat(config): 新增错误日志请求体记录开关(默认关闭)

- 新增环境变量 ERROR_LOG_RECORD_REQUEST_BODY,默认 false
- Settings 增加该配置,并在各服务写入错误日志时按开关决定是否
  入库请求体,降低敏感信息泄露风险
- 配置编辑页新增对应开关,前端初始化默认值;.env.example、
  README/README_ZH 同步更新
- db: add_error_log 支持 None 请求体并更稳健解析字符串/字典
- perf(db): 将错误日志批量删除 batch_size 从 500 下调到 200,
  兼容 SQLite/MySQL 参数上限并提升稳定性
- docs: 补充 aliyun_oss 上传提供商与 OSS 配置示例
- style: 轻微代码格式化与导入顺序优化
This commit is contained in:
snaily
2025-09-18 04:21:28 +08:00
parent 7dbd3ad693
commit 708fb1604b
12 changed files with 106 additions and 34 deletions
@@ -144,7 +144,9 @@ class OpenAICompatiableService:
error_type="openai-compatiable-stream",
error_log=error_log_msg,
error_code=status_code,
request_msg=payload,
request_msg=(
payload if settings.ERROR_LOG_RECORD_REQUEST_BODY else None
),
request_datetime=request_datetime,
)