From 92b44f3a26ed4d5587ea45b2ba3869b0b5f0eea8 Mon Sep 17 00:00:00 2001 From: Matt Oberle Date: Fri, 20 Sep 2019 12:20:13 -0400 Subject: [PATCH] changes log level for 404s from ERROR to INFO When a page does not exist (ie. 404) Amphora was producing an ERROR-level (50) message. This devalued the meaning of the ERROR level by polluting logs with errors for things like requests to '/favicon' that browsers automatically make. A 404 is not an error, it's expected behavior. I think INFO is a suitable level for 404s because they are mostly noise; no additional value is provided to what one can glean from making a client-side request. --- lib/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/render.js b/lib/render.js index 2f382bef..372301f8 100644 --- a/lib/render.js +++ b/lib/render.js @@ -277,7 +277,7 @@ function renderExpressRoute(req, res, next) { return module.exports.renderUri(pageReference, req, res, hrStart) .catch((error) => { if (error.name === 'NotFoundError') { - log('error', `could not find resource ${req.uri}`, { + log('info', `could not find resource ${req.uri}`, { message: error.message }); next();