mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
logging: Fix super verbose logging of 404 errors.
(imported from commit bb2b4f0c3cf37c16d5c634d22b7cc576ee00e5f4)
This commit is contained in:
@@ -39,9 +39,12 @@ class LogRequests(object):
|
||||
time_delta, query_time, len(connection.queries),
|
||||
request.get_full_path(), email))
|
||||
|
||||
# Log some additional data whenever we return a 40x error
|
||||
if 400 <= response.status_code < 500:
|
||||
logger.info('status=%3d, data=%s, uid=%s' % (response.status_code, response.content, email))
|
||||
# Log some additional data whenever we return certain 40x errors
|
||||
if 400 <= response.status_code < 500 and response.status_code not in [401, 404, 405]:
|
||||
content = response.content
|
||||
if len(content) > 100:
|
||||
content = "[content more than 100 characters]"
|
||||
logger.info('status=%3d, data=%s, uid=%s' % (response.status_code, content, email))
|
||||
return response
|
||||
|
||||
class JsonErrorHandler(object):
|
||||
|
||||
Reference in New Issue
Block a user