|
@@ -5,7 +5,9 @@ from typing import TYPE_CHECKING
|
|
|
|
|
|
from loguru import logger
|
|
|
|
|
|
+
|
|
|
from open_webui.env import (
|
|
|
+ AUDIT_UVICORN_LOGGER_NAMES,
|
|
|
AUDIT_LOG_FILE_ROTATION_SIZE,
|
|
|
AUDIT_LOG_LEVEL,
|
|
|
AUDIT_LOGS_FILE_PATH,
|
|
@@ -128,11 +130,13 @@ def start_logger():
|
|
|
logging.basicConfig(
|
|
|
handlers=[InterceptHandler()], level=GLOBAL_LOG_LEVEL, force=True
|
|
|
)
|
|
|
+
|
|
|
for uvicorn_logger_name in ["uvicorn", "uvicorn.error"]:
|
|
|
uvicorn_logger = logging.getLogger(uvicorn_logger_name)
|
|
|
uvicorn_logger.setLevel(GLOBAL_LOG_LEVEL)
|
|
|
uvicorn_logger.handlers = []
|
|
|
- for uvicorn_logger_name in ["uvicorn.access"]:
|
|
|
+
|
|
|
+ for uvicorn_logger_name in AUDIT_UVICORN_LOGGER_NAMES:
|
|
|
uvicorn_logger = logging.getLogger(uvicorn_logger_name)
|
|
|
uvicorn_logger.setLevel(GLOBAL_LOG_LEVEL)
|
|
|
uvicorn_logger.handlers = [InterceptHandler()]
|