feat(logging): add structured JSON logging for production, human-readable text for development

This commit is contained in:
2026-02-19 19:07:08 +01:00
parent f4c74230ec
commit 764a2f7579
2 changed files with 70 additions and 4 deletions

View File

@@ -47,10 +47,9 @@ from app.jobs.mitre_sync_job import start_scheduler, scheduler
_IS_PRODUCTION = os.environ.get("AEGIS_ENV", "").lower() == "production"
# ── Logging ───────────────────────────────────────────────────────────────
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)-8s %(name)s%(message)s",
)
from app.logging_config import setup_logging
setup_logging()
@asynccontextmanager
async def lifespan(app: FastAPI):