conductor-checkpoint-msg_01K7QC1X8iPiYaMdvbi7WtR5

This commit is contained in:
Daniel Chalef 2025-10-30 06:45:26 -07:00
parent ae47a7087f
commit 61c46e258c

View file

@ -52,10 +52,13 @@ SEMAPHORE_LIMIT = int(os.getenv('SEMAPHORE_LIMIT', 10))
# Configure structured logging with timestamps
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
format=LOG_FORMAT,
datefmt=DATE_FORMAT,
stream=sys.stderr,
)
@ -66,6 +69,19 @@ logging.getLogger('mcp.server.streamable_http_manager').setLevel(
logging.WARNING
) # Reduce MCP noise
# Patch uvicorn's logging config to use our format
def configure_uvicorn_logging():
"""Configure uvicorn loggers to match our format after they're created."""
for logger_name in ['uvicorn', 'uvicorn.error', 'uvicorn.access']:
uvicorn_logger = logging.getLogger(logger_name)
# Remove existing handlers and add our own with proper formatting
uvicorn_logger.handlers.clear()
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT))
uvicorn_logger.addHandler(handler)
uvicorn_logger.propagate = False
logger = logging.getLogger(__name__)
# Create global config instance - will be properly initialized later
@ -855,6 +871,10 @@ async def run_mcp_server():
logger.info(' Transport: HTTP (streamable)')
logger.info('=' * 60)
logger.info('For MCP clients, connect to the /mcp/ endpoint above')
# Configure uvicorn logging to match our format
configure_uvicorn_logging()
await mcp.run_streamable_http_async()
else:
raise ValueError(