Skip to content

Commit 981460c

Browse files
committed
Fix excess logging issues
1 parent 395cd1f commit 981460c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
],
2727
"env": {
2828
"PYTHONPATH": "${__dirname}/server/lib",
29-
"LOGLEVEL": "INFO",
29+
"LOGLEVEL": "WARNING",
3030
"NO_COLOR": "1",
3131
"ZENML_LOGGING_COLORS_DISABLED": "true",
32+
"ZENML_LOGGING_VERBOSITY": "WARN",
33+
"ZENML_ENABLE_RICH_TRACEBACK": "false",
3234
"PYTHONUNBUFFERED": "1",
3335
"PYTHONIOENCODING": "UTF-8",
3436
"ZENML_STORE_URL": "${user_config.zenml_store_url}",

mcp-zenml.dxt

566 Bytes
Binary file not shown.

server/zenml_server.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,23 @@
2626
logger = logging.getLogger(__name__)
2727

2828
# Configure minimal logging to stderr
29-
log_level_name = os.environ.get("LOGLEVEL", "INFO").upper()
30-
log_level = getattr(logging, log_level_name, logging.INFO)
29+
log_level_name = os.environ.get("LOGLEVEL", "WARNING").upper()
30+
log_level = getattr(logging, log_level_name, logging.WARNING)
3131

32-
# Simple stderr logging configuration
32+
# Simple stderr logging configuration - explicitly use stderr to avoid JSON protocol issues
3333
logging.basicConfig(
3434
level=log_level,
3535
format="%(levelname)s: %(message)s",
36+
stream=sys.stderr,
3637
)
3738

39+
# Suppress all INFO level logging from all modules to prevent JSON protocol interference
40+
logging.getLogger().setLevel(logging.WARNING)
41+
42+
# Specifically suppress ZenML's internal logging to prevent JSON protocol issues
43+
logging.getLogger("zenml").setLevel(logging.WARNING)
44+
logging.getLogger("zenml.client").setLevel(logging.WARNING)
45+
3846
# Type variable for function return type
3947
T = TypeVar("T")
4048

0 commit comments

Comments
 (0)