From 22747bddc5efd59ca60f1b2396fff53425e75413 Mon Sep 17 00:00:00 2001 From: maxonclaxon Date: Wed, 20 Mar 2024 01:48:13 +0300 Subject: [PATCH] feat: update logging config --- app/api/app.py | 3 +++ main.py | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/app.py b/app/api/app.py index 4171c2e..27bbcca 100644 --- a/app/api/app.py +++ b/app/api/app.py @@ -10,6 +10,7 @@ from prometheus_fastapi_instrumentator import Instrumentator from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration +from uvicorn.config import LOGGING_CONFIG from app.api.admin import create_admin from app.api.routes.root import router @@ -27,6 +28,8 @@ traces_sample_rate=1.0, ) +LOGGING_CONFIG["formatters"]["default"]["fmt"] = "%(asctime)s [%(name)s] %(levelprefix)s %(message)s" + app = fastapi.FastAPI() diff --git a/main.py b/main.py index d7b8df3..b320546 100644 --- a/main.py +++ b/main.py @@ -6,11 +6,8 @@ import uvicorn -from uvicorn.config import LOGGING_CONFIG from app.api.app import app -LOGGING_CONFIG["formatters"]["default"]["fmt"] = "%(asctime)s [%(name)s] %(levelprefix)s %(message)s" - if __name__ == "__main__": uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file