From 4f1e717b1619bb883ac5433a9bb755682c662c9e Mon Sep 17 00:00:00 2001 From: "marvin-context-protocol[bot]" <225465937+marvin-context-protocol[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 22:33:46 +0000 Subject: [PATCH] Fix log_level in fastmcp.json not being applied to global settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../mcp_server_config/v1/mcp_server_config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py b/src/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py index 0f402e084..43dcc42f5 100644 --- a/src/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py +++ b/src/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py @@ -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():