Skip to content

Commit

Permalink
changes log level for 404s from ERROR to INFO
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattoberle committed Sep 20, 2019
1 parent 34997b6 commit 83ca946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 83ca946

Please sign in to comment.