mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
hide more 404 and 304 errors from daphne logs
This commit is contained in:
parent
52386d9c16
commit
f6ca48835a
2 changed files with 5 additions and 1 deletions
|
@ -522,7 +522,7 @@ LOGGING = {
|
||||||
"django.request": { # only logs 4xx and 5xx errors
|
"django.request": { # only logs 4xx and 5xx errors
|
||||||
"propagate": False,
|
"propagate": False,
|
||||||
"handlers": ["default", "logfile"],
|
"handlers": ["default", "logfile"],
|
||||||
"level": "INFO",
|
"level": "ERROR",
|
||||||
"filters": ["noisyrequestsfilter"],
|
"filters": ["noisyrequestsfilter"],
|
||||||
},
|
},
|
||||||
"django.db.backends": {
|
"django.db.backends": {
|
||||||
|
|
|
@ -37,6 +37,10 @@ class ModifiedAccessLogGenerator(access.AccessLogGenerator):
|
||||||
return
|
return
|
||||||
if request.endswith("/favicon.ico") or request.endswith("/robots.txt") or request.endswith("/screenshot.png"):
|
if request.endswith("/favicon.ico") or request.endswith("/robots.txt") or request.endswith("/screenshot.png"):
|
||||||
return
|
return
|
||||||
|
if request.endswith('.css') or request.endswith('.js') or request.endswith('.woff') or request.endswith('.ttf'):
|
||||||
|
return
|
||||||
|
if str(status) in ('404', '304'):
|
||||||
|
return
|
||||||
|
|
||||||
# clean up the log format to mostly match the same format as django.conf.settings.LOGGING rich formats
|
# clean up the log format to mostly match the same format as django.conf.settings.LOGGING rich formats
|
||||||
self.stream.write(
|
self.stream.write(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue