11 lines
296 B
Python
11 lines
296 B
Python
import logging
|
|
|
|
|
|
class IgnoreHealthAndFavicon(logging.Filter):
|
|
def __init__(self, name: str = ""):
|
|
super().__init__(name)
|
|
|
|
def filter(self, record: logging.LogRecord) -> bool:
|
|
msg = record.getMessage()
|
|
return all(p not in msg for p in ["/health", "/favicon.ico"])
|