Ignore haproxy check in logging.

This commit is contained in:
Samuel Clay 2021-02-24 12:00:12 -05:00
parent c12b2493ed
commit 297111917e

View file

@ -1,6 +1,10 @@
from django.conf import settings
from utils import log as logging
IGNORE_PATHS = [
"_haproxychk",
]
class DumpRequestMiddleware:
def process_request(self, request):
if settings.DEBUG:
@ -8,7 +12,7 @@ class DumpRequestMiddleware:
request_items = request_data.items()
if request_items:
logging.debug(" ---> ~FC%s ~SN~FK~BC%s~BT~ST ~FC%s~BK~FC" % (request.method, request.path, dict(request_items)))
else:
elif request.path not in IGNORE_PATHS:
logging.debug(" ---> ~FC%s ~SN~FK~BC%s~BT~ST" % (request.method, request.path))
def __init__(self, get_response=None):