Skip to content

Commit

Permalink
feat(deps): replace logentries-logformat with @emartech/json-logger
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the package now uses @emartech/json-logger instead of logentries-logformat

Co-authored-by: Dora Sztanko <dora.sztanko@emarsys.com>
  • Loading branch information
knagy and Dora Sztanko committed May 8, 2023
1 parent c966f3c commit cbc2167
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8,122 deletions.
8 changes: 5 additions & 3 deletions app/middlewares/error-handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

var logger = require('logentries-logformat')('app');
const { createLogger } = require('@emartech/json-logger');

var logger = createLogger('app');

var errorPagePath;

Expand All @@ -24,11 +26,11 @@ module.exports = function(errorPage) {
if (ex.code === 401) {
this.status = 401;
renderError(this, 'We\'re sorry, but You are not authorized to take this action');
logger.error('authentication', ex.message);
logger.error('authentication', { message: ex.message });
} else {
this.status = 500;
renderError(this, 'We\'re sorry, but something went wrong');
logger.error('internal', ex.message, { stack: ex.stack });
logger.fromError('internal', ex);
}
}
}
Expand Down
Loading

0 comments on commit cbc2167

Please sign in to comment.