Fix log_level in fastmcp.json not being applied to global settings

The log_level configured in fastmcp.json deployment section was parsed
but never applied to the global fastmcp.settings.log_level, causing
the server to use the default INFO level instead of the configured level.

This fix updates apply_runtime_settings() to:
- Set fastmcp.settings.log_level to the configured value
- Reconfigure logging with the new level

Fixes #1825

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
This commit is contained in:
marvin-context-protocol[bot] 2025-09-15 22:33:46 +00:00
commit 4f1e717b16

View file

@ -95,6 +95,21 @@ class Deployment(BaseModel):
import os
from pathlib import Path
# Apply log level to global settings
if self.log_level:
import fastmcp
from fastmcp.utilities.logging import configure_logging
# Update the global settings
fastmcp.settings.log_level = self.log_level
# Reconfigure logging with the new level
if fastmcp.settings.log_enabled:
configure_logging(
level=self.log_level,
enable_rich_tracebacks=fastmcp.settings.enable_rich_tracebacks,
)
# Set environment variables with interpolation support
if self.env:
for key, value in self.env.items():