logging feature

This commit is contained in:
2026-08-24 18:22:43 +03:00
parent 88bd61d28b
commit 443d40d7b6
8 changed files with 104 additions and 4 deletions
+6 -2
View File
@@ -4,6 +4,7 @@ from pathlib import Path
# import uvicorn
from fastapi import FastAPI
from src.logging.logger import LoggingMiddleware, ProcessingTimeMiddleware
from src.web.protected_routes.auth_routes import router as protected_router
from src.web.protected_routes.protected_user_action_routes import (
router as protected_user_action_routes,
@@ -16,8 +17,10 @@ async def lifespan(app: FastAPI):
yield
print("shutting down")
app=FastAPI(root_path="/", lifespan=lifespan)
app.add_middleware(LoggingMiddleware)
app.add_middleware(ProcessingTimeMiddleware)
app.include_router(router=protected_router)
app.include_router(router=protected_user_action_routes)
@@ -32,7 +35,8 @@ def create_dirs():
dirs_to_create=("./DB",
"./uploads/upload",
"./uploads/upload_bad",
"./uploads/upload_finished")
"./uploads/upload_finished",
"./logs")
for x in dirs_to_create:
Path(x).mkdir(parents=True, exist_ok=True)