mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 13:34:17 +02:00
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:
parent
f4f1905c89
commit
4f1e717b16
1 changed files with 15 additions and 0 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue