新增请求/响应日志中间件,支持详细的请求和响应信息记录
All checks were successful
Build and Push OCI GenAI Gateway Docker Image / docker-build-push (push) Successful in 34s

This commit is contained in:
2025-12-09 17:46:07 +08:00
parent 6a5e6bcf7c
commit ba7ec48c4f
4 changed files with 172 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ from api.routers import models, chat, embeddings
from api.schemas import ErrorResponse, ErrorDetail
from api.error_handler import OCIErrorHandler
from api.exceptions import ModelNotFoundException, InvalidModelTypeException
from api.middleware import setup_logging_middleware
# Configure logging
@@ -133,6 +134,9 @@ app.add_middleware(
allow_headers=["*"],
)
# Add logging middleware (for request/response debugging)
setup_logging_middleware(app)
# Exception handlers
@app.exception_handler(ModelNotFoundException)