fix: add visible startup progress logs to lifespan
- Added logger.info() calls before each startup step (encryption key, Alembic, init_db, admin bootstrap, scheduler, app complete) - Previously only logger.reason() was used which logs at DEBUG level and is invisible in production/development at INFO log level - This fixes 'no backend logs visible' when running via ./run.sh
This commit is contained in:
@@ -75,12 +75,18 @@ async def lifespan(app: FastAPI):
|
||||
# Startup
|
||||
seed_trace_id()
|
||||
with belief_scope("startup_event"):
|
||||
logger.info("🔐 Ensuring encryption key...")
|
||||
ensure_encryption_key()
|
||||
logger.info("📦 Running Alembic migrations...")
|
||||
run_alembic_migrations()
|
||||
logger.info("🗄️ Initializing database tables...")
|
||||
init_db()
|
||||
logger.info("👤 Bootstrapping admin user...")
|
||||
ensure_initial_admin_user()
|
||||
logger.info("⏰ Starting scheduler...")
|
||||
scheduler = get_scheduler_service()
|
||||
scheduler.start()
|
||||
logger.info("✅ Application startup complete")
|
||||
yield
|
||||
# Shutdown
|
||||
scheduler.stop()
|
||||
|
||||
Reference in New Issue
Block a user