mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	Clean up slow log displays
(imported from commit cab99eeaef14e1f24a6b09b0cdbcdcc45bcb620a)
This commit is contained in:
		| @@ -138,15 +138,17 @@ class LogRequests(object): | ||||
|         except Exception: | ||||
|             client = "?" | ||||
|  | ||||
|         logger_line = '%-15s %-7s %3d %5s%s%s%s%s %s (%s via %s)' % \ | ||||
|                         (remote_ip, request.method, response.status_code, | ||||
|                         format_timedelta(time_delta), optional_orig_delta, | ||||
|         logger_timing = '%5s%s%s%s%s %s (%s via %s)' % \ | ||||
|                          (format_timedelta(time_delta), optional_orig_delta, | ||||
|                           memcached_output, bugdown_output, | ||||
|                           db_time_output, request.get_full_path(), email, client) | ||||
|         logger_line = '%-15s %-7s %3d %s' % \ | ||||
|                         (remote_ip, request.method, response.status_code, | ||||
|                          logger_timing) | ||||
|         logger.info(logger_line) | ||||
|  | ||||
|         if time_delta >= 1: | ||||
|             queue_json_publish("slow_queries", logger_line, lambda e: None) | ||||
|             queue_json_publish("slow_queries", logger_timing, lambda e: None) | ||||
|  | ||||
|         # 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]: | ||||
|   | ||||
| @@ -123,7 +123,7 @@ class SlowQueryWorker(QueueProcessingWorker): | ||||
|             if len(slow_queries) > 0: | ||||
|                 topic = "%s: slow queries" % (settings.STATSD_PREFIX,) | ||||
|  | ||||
|                 content = "Slow query report on %s:\n\n" % (settings.STATSD_PREFIX,) | ||||
|                 content = "" | ||||
|                 for query in slow_queries: | ||||
|                     content += "    %s\n" % (query,) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user