fix: Configure consistent logging format between uvicorn and MCP server
- Use simplified format matching uvicorn's default (LEVEL message) - Remove timestamps from custom logger format - Suppress verbose MCP and uvicorn access logs - Improve readability of server startup output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
230b82a047
commit
2037df875d
1 changed files with 8 additions and 2 deletions
|
|
@ -51,12 +51,18 @@ else:
|
|||
SEMAPHORE_LIMIT = int(os.getenv('SEMAPHORE_LIMIT', 10))
|
||||
|
||||
|
||||
# Configure logging
|
||||
# Configure logging to match uvicorn format
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
format='%(levelname)-8s %(message)s', # Match uvicorn's default format
|
||||
stream=sys.stderr,
|
||||
)
|
||||
|
||||
# Configure specific loggers
|
||||
logging.getLogger('uvicorn').setLevel(logging.INFO)
|
||||
logging.getLogger('uvicorn.access').setLevel(logging.WARNING) # Reduce access log noise
|
||||
logging.getLogger('mcp.server.streamable_http_manager').setLevel(logging.WARNING) # Reduce MCP noise
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Create global config instance - will be properly initialized later
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue