Compare commits
1 Commits
v1.1.0-alp
...
v1.1.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| d80eac4a0d |
@@ -192,14 +192,12 @@ def _print_mcp_config(external_port: int, tokens: list) -> None:
|
|||||||
|
|
||||||
|
|
||||||
class HealthCheckFilter(logging.Filter):
|
class HealthCheckFilter(logging.Filter):
|
||||||
"""Filter out health check requests at INFO level."""
|
"""Suppress health check requests unless LOG_LEVEL is DEBUG."""
|
||||||
|
|
||||||
def filter(self, record: logging.LogRecord) -> bool:
|
def filter(self, record: logging.LogRecord) -> bool:
|
||||||
message = record.getMessage()
|
if "/health" in record.getMessage():
|
||||||
if "/health" in message:
|
# Only show health checks at DEBUG level
|
||||||
# Downgrade to DEBUG by changing the level
|
return os.environ.get("LOG_LEVEL", "INFO").upper() == "DEBUG"
|
||||||
record.levelno = logging.DEBUG
|
|
||||||
record.levelname = "DEBUG"
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user