mirror of https://github.com/zulip/zulip.git
logging: Update slow query logger to not display client string.
I believe with this change the log lines will fit much better into Zulip, and the Client string was I suspect rarely important for responding to slow queries (and is always available in the main log anyway). (imported from commit ad56f446bf3fb96a14a56b825f46c1dad9b6babe)
This commit is contained in:
parent
f3fee40d1d
commit
1d4f39f55a
|
@ -138,17 +138,18 @@ class LogRequests(object):
|
||||||
except Exception:
|
except Exception:
|
||||||
client = "?"
|
client = "?"
|
||||||
|
|
||||||
logger_timing = '%5s%s%s%s%s %s (%s via %s)' % \
|
logger_client = "(%s via %s)" % (email, client)
|
||||||
|
logger_timing = '%5s%s%s%s%s %s' % \
|
||||||
(format_timedelta(time_delta), optional_orig_delta,
|
(format_timedelta(time_delta), optional_orig_delta,
|
||||||
memcached_output, bugdown_output,
|
memcached_output, bugdown_output,
|
||||||
db_time_output, request.path, email, client)
|
db_time_output, request.path)
|
||||||
logger_line = '%-15s %-7s %3d %s' % \
|
logger_line = '%-15s %-7s %3d %s %s' % \
|
||||||
(remote_ip, request.method, response.status_code,
|
(remote_ip, request.method, response.status_code,
|
||||||
logger_timing)
|
logger_timing, logger_client)
|
||||||
logger.info(logger_line)
|
logger.info(logger_line)
|
||||||
|
|
||||||
if time_delta >= 1:
|
if time_delta >= 1:
|
||||||
queue_json_publish("slow_queries", logger_timing, lambda e: None)
|
queue_json_publish("slow_queries", "%s (%s)" % (logger_timing, email), lambda e: None)
|
||||||
|
|
||||||
# Log some additional data whenever we return certain 40x errors
|
# 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]:
|
if 400 <= response.status_code < 500 and response.status_code not in [401, 404, 405]:
|
||||||
|
|
Loading…
Reference in New Issue