Logger config_ surpress 403 errors from face_detection and auomtation as this is caused by permissions

This commit is contained in:
2026-05-20 11:46:56 +02:00
parent 3fa4a57532
commit b603832c4d
+12 -1
View File
@@ -33,9 +33,20 @@ class IgnoreSuccessfulStatusAccessFilter(logging.Filter):
'"GET /sample/spreadsheet HTTP/1.1" 200',
)
_SUPPRESSED_EXPECTED_403_MESSAGES = (
'"GET /sse/face_detection HTTP/1.1" 403',
'"GET /sse/automation_progress HTTP/1.1" 403',
)
def filter(self, record: logging.LogRecord) -> bool:
message = record.getMessage()
return not any(entry in message for entry in self._SUPPRESSED_SUCCESS_MESSAGES)
return not any(
entry in message
for entry in (
*self._SUPPRESSED_SUCCESS_MESSAGES,
*self._SUPPRESSED_EXPECTED_403_MESSAGES,
)
)
def get_uvicorn_logging_config() -> dict: