From 8dc73fdbdbc070cfa7fd01034277296a10b938dc Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 22:24:34 +0200 Subject: [PATCH] enh: remove /health logging --- backend/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/config.py b/backend/config.py index fe68eee34..0ee8f2aac 100644 --- a/backend/config.py +++ b/backend/config.py @@ -77,6 +77,16 @@ for source in log_sources: log.setLevel(SRC_LOG_LEVELS["CONFIG"]) + +class EndpointFilter(logging.Filter): + def filter(self, record: logging.LogRecord) -> bool: + return record.getMessage().find("/health") == -1 + + +# Filter out /endpoint +logging.getLogger("uvicorn.access").addFilter(EndpointFilter()) + + WEBUI_NAME = os.environ.get("WEBUI_NAME", "Open WebUI") if WEBUI_NAME != "Open WebUI": WEBUI_NAME += " (Open WebUI)"