import logging class IgnoreHealth(logging.Filter): def filter(self, record: logging.LogRecord) -> bool: msg = record.getMessage() return "/health" not in msg