Zapomenutý filtr

This commit is contained in:
MaM Web user 2021-09-06 14:13:37 +02:00
parent d1a1e601c2
commit 3e7d9ae7ec

6
various/log_filters.py Normal file
View file

@ -0,0 +1,6 @@
from logging import Filter, INFO
class Http404AsInfoFilter(Filter):
def filter(self, record):
if record.name == 'django.request' and record.status_code == 404:
record.levelno = INFO
return 1 # Keep the log record