arcade-mcp/libs/arcade-mcp-server/arcade_mcp_server
Eric Gustin d7d765343e
Fix multiple worker log level bug (#758)
When running `arcade_mcp_server` with `workers > 1`, uvicorn spawns
worker subprocesses that directly call `create_arcade_mcp_factory()`
without going through `main()`. Since `setup_logging()` is only called
in `main()`, these subprocesses have no logging configuration, causing:

1. Standard Python logging not intercepted by Loguru
    
2. DEBUG-level logs from libraries like urllib3 appearing when OTEL is
enabled
    
3. Inconsistent log formats between main process and workers

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches process-wide logging initialization for uvicorn worker
subprocesses, which can affect log levels/handlers and output across the
server. Functional impact is limited to observability but could change
verbosity when OTEL or libraries emit logs.
> 
> **Overview**
> Fixes multi-worker/reload mode logging by configuring Loguru inside
`create_arcade_mcp_factory()` (using `ARCADE_MCP_DEBUG` to set `INFO` vs
`DEBUG`) so uvicorn-spawned worker subprocesses get the same
logging/interception as `main()`.
> 
> Adds regression tests that assert the factory filters DEBUG logs by
default and enables them when `ARCADE_MCP_DEBUG=true`, and bumps
`arcade-mcp-server` to `1.15.2`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0c262eb9716ecbd589f1524842243a7aed80666e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-30 15:37:52 -08:00
..
auth PagerDuty typed OAuth object (#718) 2025-12-15 17:42:11 -03:00
fastapi Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
managers Rename _meta requirements field to arcade_requirements (#616) 2025-10-14 19:01:05 -07:00
middleware MCP Local (#563) 2025-09-25 15:28:15 -07:00
resource_server Support Ed25519 Algorithm (#742) 2026-01-16 15:55:05 -08:00
transports Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
usage Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
__init__.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
__main__.py Ability to run multiple uvicorn workers (#721) 2025-12-10 11:06:24 -08:00
context.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
convert.py Rename _meta requirements field to arcade_requirements (#616) 2025-10-14 19:01:05 -07:00
exceptions.py Re-import arcade_core errors into arcade_mcp_server (#620) 2025-10-13 17:48:54 -07:00
lifespan.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
logging_utils.py Add startup warnings for missing secrets (#712) 2025-12-05 13:39:04 -08:00
mcp_app.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
py.typed Inform type checkers that arcade_mcp_server has inline type annotations (#720) 2025-12-09 15:35:15 -08:00
server.py Fix broken links (#738) 2026-01-05 13:27:16 -08:00
session.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
settings.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
types.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
worker.py Fix multiple worker log level bug (#758) 2026-01-30 15:37:52 -08:00