From 25448bfef41c3c14a3dd20bdcbc021d75f7a9e2c Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Wed, 18 Mar 2020 08:41:11 -0400 Subject: [PATCH] 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. --- libraries/metrics/http.coffee | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libraries/metrics/http.coffee b/libraries/metrics/http.coffee index e3097c8c72..db7d56b2da 100644 --- a/libraries/metrics/http.coffee +++ b/libraries/metrics/http.coffee @@ -49,10 +49,5 @@ module.exports.monitor = (logger) -> "content-length": res._headers?["content-length"] statusCode: res.statusCode "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()