zulip/zerver
Mateusz Mandera d21a1fe47f middleware: Log 5xx json_errors in JsonErrorHandler.
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.
2022-08-31 14:43:15 -07:00
..
actions typing: Broaden parameter type for bulk_regenerate_api_keys. 2022-08-29 11:06:41 -07:00
data_import import: Fix timestamp check in long_term_idle_helper. 2022-08-29 15:18:00 -07:00
integration_fixtures/nagios
lib send_analytics_to_remote_server: Log connection errors with traceback. 2022-08-31 14:43:15 -07:00
management logout_all_users: Add --rotate-api-keys option to the command. 2022-08-15 17:58:05 -07:00
migrations settings: Make AVATAR_SALT mandatory. 2022-08-25 12:13:03 -07:00
openapi bots: Refer to notification bot messages as automated notices. 2022-08-29 10:54:08 -07:00
tests middleware: Log 5xx json_errors in JsonErrorHandler. 2022-08-31 14:43:15 -07:00
tornado user_topic: Add user_topic event. 2022-08-04 17:44:00 -07:00
views i18n: Deal with lazy strings more carefully. 2022-08-29 10:52:45 -07:00
webhooks testing: 100% coverage for zerver/webhooks/{librato,pivotal}. 2022-08-25 12:04:24 -07:00
worker queue_processor: Fix type annotation for connection. 2022-07-26 18:00:24 -07:00
__init__.py
apps.py caching: Make sender type optional for flush_cache. 2021-07-26 14:48:07 -07:00
context_processors.py footer: Reduce links for self-hosted installations on signup pages. 2022-07-22 15:46:42 -07:00
decorator.py decorator: Rename profile to user_profile. 2022-08-17 12:05:38 -07:00
filters.py typing: Fix function signatures. 2021-08-20 05:54:19 -07:00
forms.py i18n: Deal with lazy strings more carefully. 2022-08-29 10:52:45 -07:00
logging_handlers.py python: Use Python 3.8 typing.{Protocol,TypedDict}. 2022-04-27 12:57:49 -07:00
middleware.py middleware: Log 5xx json_errors in JsonErrorHandler. 2022-08-31 14:43:15 -07:00
models.py i18n: Deal with lazy strings more carefully. 2022-08-29 10:52:45 -07:00
signals.py requirements: Upgrade to Django 4.0. 2022-07-13 16:07:17 -07:00