From 7589ad043dc48902df94890b7c8d8e2c3496e502 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 7 Nov 2017 07:14:38 -0800 Subject: [PATCH] changed slack error logging to include warn --- config/slackConfig.js | 9 +++++---- models/claim.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/slackConfig.js b/config/slackConfig.js index 74227bbd..84ab3376 100644 --- a/config/slackConfig.js +++ b/config/slackConfig.js @@ -6,7 +6,7 @@ module.exports = (winston) => { // add a transport for errors to slack winston.add(winstonSlackWebHook, { name : 'slack-errors-transport', - level : 'error', + level : 'warn', webhookUrl: config.logging.slackWebHook, channel : config.logging.slackErrorChannel, username : 'spee.ch', @@ -21,9 +21,10 @@ module.exports = (winston) => { iconEmoji : ':nerd_face:', }); // send test message - winston.error('Slack error logging is online.'); - winston.info('Slack info logging is online.'); + winston.error('Slack "error" logging is online.'); + winston.warn('Slack "warning" logging is online.'); + winston.info('Slack "info" logging is online.'); } else { - winston.error('Slack logging is not enabled because no SLACK_WEB_HOOK env var provided.'); + winston.warn('Slack logging is not enabled because no SLACK_WEB_HOOK env var provided.'); } }; diff --git a/models/claim.js b/models/claim.js index 64a54b02..7145e9e0 100644 --- a/models/claim.js +++ b/models/claim.js @@ -321,7 +321,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D case 1: return resolve(result[0]); default: - logger.error('more than one entry matches that name and claimID'); + logger.warn(`more than one entry matches that name (${name}) and claimID (${claimId})`); return resolve(result[0]); } })