mirror of https://github.com/zulip/zulip.git
d21a1fe47f
django.request logs responses with 5xx response codes (our configuration of the logger prevents it from logging 4xx as well which it normally does too). However, it does it without the traceback which results in quite unhelpful log message that look like "Bad Gateway:/api/v1/users/me/apns_device_token" - particularly confusing when sent via email to server admins. The solution here is to do the logging ourselves, using Django's log_response() (which is meant for this purpose), and including the traceback. Django tracks (via response._has_been_logged attribute) that the response has already been logged, and knows to not duplicate that action. See log_response() in django's codebase for these details. Fixes #19596. |
||
---|---|---|
.. | ||
actions | ||
data_import | ||
integration_fixtures/nagios | ||
lib | ||
management | ||
migrations | ||
openapi | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |