favicon 204

This commit is contained in:
Mateusz Gruszczyński
2025-10-06 09:02:34 +02:00
parent 6db9d9ccd4
commit cfdf38ce1d
3 changed files with 12 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
import logging
class IgnoreHealth(logging.Filter):
def __init__(self, name: str = ""): super().__init__(name)
class IgnoreHealthAndFavicon(logging.Filter):
def __init__(self, name: str = ""):
super().__init__(name)
def filter(self, record: logging.LogRecord) -> bool:
return "/health" not in record.getMessage()
msg = record.getMessage()
return all(p not in msg for p in ["/health", "/favicon.ico"])