Skip to content

Commit

Permalink
Merge pull request #114 from Financial-Times/reliability-kit-logger
Browse files Browse the repository at this point in the history
Breaking: replace n-logger with Reliability Kit logger
  • Loading branch information
rowanmanning authored Aug 8, 2023
2 parents b15427b + 93306f6 commit a18fea9
Show file tree
Hide file tree
Showing 6 changed files with 939 additions and 179 deletions.
2 changes: 1 addition & 1 deletion lib/active.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const dynamos = require('./dynamos');
const get = require('./get');
const logger = require('@financial-times/n-logger').default;
const logger = require('@dotcom-reliability-kit/logger');
const surviver = require('./promise-surviver');

const HEALTHCHECK_URL = 'https://www.ft.com/__$HEALTHCHECK';
Expand Down
4 changes: 2 additions & 2 deletions lib/batch-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const denodeify = require('denodeify');
const timeoutPromise = require('./timeout');
const logger = require('@financial-times/n-logger').default;
const logger = require('@dotcom-reliability-kit/logger');
const calculateResponseTime = require('./calculate-response-time');
const encodeDynamoObject = require('./encode-dynamo-object');
const decodeDynamoObject = require('./decode-dynamo-object');
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = opts => {
});
}, timeout)
.catch(error => {
logger.info({ event: 'URL_MGMT_API_ERROR', error: error.toString() });
logger.info({ event: 'URL_MGMT_API_ERROR' }, error);
if (error.toString().indexOf('timed out') > -1) {
metrics.count(`${table}_status_timeout`);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const denodeify = require('denodeify');
const timeoutPromise = require('./timeout');
const logger = require('@financial-times/n-logger').default;
const logger = require('@dotcom-reliability-kit/logger');
const calculateResponseTime = require('./calculate-response-time');
const encodeDynamoObject = require('./encode-dynamo-object');
const decodeDynamoObject = require('./decode-dynamo-object');
Expand Down Expand Up @@ -39,7 +39,7 @@ module.exports = opts => {
});
}, timeout)
.catch(error => {
logger.info({ event: 'URL_MGMT_API_ERROR', error: error.toString() });
logger.info({ event: 'URL_MGMT_API_ERROR' }, error);
if (error.toString().indexOf('timed out') > -1) {
metrics.count(`${table}_status_timeout`);
}
Expand Down
Loading

0 comments on commit a18fea9

Please sign in to comment.