Skip to content

Commit

Permalink
Disable logging of DisallowedHost to reduce log noise
Browse files Browse the repository at this point in the history
Django will still respond with HTTP 400 to requests with unexpected hostnames, but we won't get the log noise
  • Loading branch information
stevejalim authored and pmac committed Jan 18, 2022
1 parent c5750ad commit 1df5e37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions basket/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import struct
import sys
from datetime import timedelta
from pathlib import Path

import dj_database_url
import django_cache_url
import sentry_sdk
from decouple import config, Csv, UndefinedValueError
from pathlib import Path
from decouple import Csv, UndefinedValueError, config
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration

Expand Down Expand Up @@ -360,13 +360,15 @@ def get_default_gateway_linux():
"class": "logging.StreamHandler",
"formatter": "verbose",
},
"null": {"class": "logging.NullHandler"},
},
"loggers": {
"django.db.backends": {
"level": "ERROR",
"handlers": ["console"],
"propagate": False,
},
"django.security.DisallowedHost": {"handlers": ["null"], "propagate": False},
"suds.client": {"level": "ERROR", "handlers": ["console"], "propagate": False},
},
}
Expand Down

0 comments on commit 1df5e37

Please sign in to comment.