Refactor: Modularize logging and finalize lifespan integration
This commit is contained in:
@@ -14,6 +14,7 @@ from . import config
|
||||
# from app.lib_general import common_route_params, Common_Route_Params
|
||||
import logging
|
||||
import app.log
|
||||
from app.log import setup_logging
|
||||
|
||||
# Import middleware with alias to avoid shadowing 'app' FastAPI instance
|
||||
from app.middleware import add_process_time_header as process_time_middleware
|
||||
@@ -39,10 +40,11 @@ async def lifespan(app: FastAPI):
|
||||
"""
|
||||
Handles application startup and shutdown lifecycle.
|
||||
"""
|
||||
log.setLevel(logging.INFO)
|
||||
# 1. Initialize Logging early but safely
|
||||
setup_logging(config.settings)
|
||||
log.info('### **** *** ** * Aether API v4 using FastAPI - Startup Lifespan Initiated * ** *** **** ###')
|
||||
|
||||
# 1. Bootstrapping Configuration from DB with robust error handling
|
||||
# 2. Bootstrapping Configuration from DB with robust error handling
|
||||
log.info("Bootstrapping Configuration...")
|
||||
try:
|
||||
if bootstrap_db_config(config.settings):
|
||||
|
||||
Reference in New Issue
Block a user