This commit is contained in:
eric
2026-03-10 05:25:08 -05:00
parent 68aefbcee6
commit e5c797f5de
9 changed files with 56 additions and 48 deletions

View File

@@ -51,14 +51,11 @@ async def global_exception_handler(request: Request, exc: Exception):
logging.error(f"未处理异常: {request.url.path} - {exc}", exc_info=True)
return JSONResponse(status_code=500, content={"detail": str(exc)})
# 日志
# 日志(仅控制台,不写文件,避免 git 本地/线上不一致)
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(message)s",
handlers=[
logging.FileHandler("payment_notify.log"),
logging.StreamHandler(),
],
handlers=[logging.StreamHandler()],
)
# 挂载路由