's'
This commit is contained in:
@@ -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()],
|
||||
)
|
||||
|
||||
# 挂载路由
|
||||
|
||||
Reference in New Issue
Block a user