Просмотр исходного кода

Downgrade all request logs to INFO

Commit 9056143fe36f1347a1ff985ef8592a1de7d798dd added logic to log
requests with different error levels depending on the status code. The
intention was to make the 5xx and 4xx requests stand out in Stackdriver.
Unfortunately, this also creates a lot of noise in Sentry since we log
the errors separately from the requests.

This commit brings back the former behaviour of logging all requests at
the INFO level. We can revisit this if we integrate the strategy
implemented in filestore of logging once per request.
Eric Mc Sween 6 лет назад
Родитель
Сommit
25448bfef4
1 измененных файлов с 1 добавлено и 6 удалено
  1. 1 6
      libraries/metrics/http.coffee

+ 1 - 6
libraries/metrics/http.coffee

@@ -49,10 +49,5 @@ module.exports.monitor = (logger) ->
 							"content-length": res._headers?["content-length"]
 							"content-length": res._headers?["content-length"]
 							statusCode: res.statusCode
 							statusCode: res.statusCode
 						"response-time": responseTimeMs
 						"response-time": responseTimeMs
-				if res.statusCode >= 500
-					logger.error(info, "%s %s", req.method, reqUrl)
-				else if res.statusCode >= 400 and res.statusCode < 500
-					logger.warn(info, "%s %s", req.method, reqUrl)
-				else
-					logger.info(info, "%s %s", req.method, reqUrl)
+				logger.info(info, "%s %s", req.method, reqUrl)
 		next()
 		next()