This commit is contained in:
qiaofeng1227 2023-10-21 11:36:37 +08:00
parent a787a65e6c
commit 0c901c3729
3 changed files with 13 additions and 7 deletions

View file

@ -1,4 +1,4 @@
import logging
import logging, sys
from fastapi import FastAPI, Request,Security,Depends
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse
@ -15,10 +15,16 @@ from fastapi.security.api_key import APIKeyHeader
uvicorn_logger = logging.getLogger("uvicorn")
for handler in uvicorn_logger.handlers:
uvicorn_logger.removeHandler(handler)
for handler in logger._error_logger.handlers:
uvicorn_logger.addHandler(handler)
# for handler in uvicorn_logger.handlers:
# uvicorn_logger.removeHandler(handler)
# for handler in logger._error_logger.handlers:
# uvicorn_logger.addHandler(handler)
# 创建一个日志处理器,将日志发送到 stdout
stdout_handler = logging.StreamHandler(sys.stdout)
# 将日志处理器添加到 Uvicorn 的 logger
uvicorn_logger.addHandler(stdout_handler)
uvicorn_logger.setLevel(logging.INFO)

View file

@ -1,4 +1,4 @@
# modify time: 202310201720, you can modify here to trigger Docker Build action
# modify time: 202310211140, you can modify here to trigger Docker Build action
FROM python:3.10-bullseye AS buildstage
LABEL maintainer="Websoft9<help@websoft9.com>"

View file

@ -1,5 +1,5 @@
{
"version": "0.8.26-rc1",
"version": "0.8.26-rc2",
"plugins": {
"portainer": "0.0.7",
"nginx": "0.0.5",