From 68a77885d4762839c89d098b29db8539b699088c Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 10 Feb 2020 09:03:16 -0500 Subject: [PATCH] suppress some routine server logs --- lib/api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api.js b/lib/api.js index c13f8c7c8..bd5c99629 100644 --- a/lib/api.js +++ b/lib/api.js @@ -16,11 +16,14 @@ module.exports.create = function (config) { .on('channelOpen', historyKeeper.channelOpen) .on('sessionClose', function (userId, reason) { if (['BAD_MESSAGE', 'SOCKET_ERROR', 'SEND_MESSAGE_FAIL_2'].indexOf(reason) !== -1) { + if (reason && reason.code === 'ECONNRESET') { return; } return void log.error('SESSION_CLOSE_WITH_ERROR', { userId: userId, reason: reason, }); } + + if (reason && reason === 'SOCKET_CLOSED') { return; } log.verbose('SESSION_CLOSE_ROUTINE', { userId: userId, reason: reason,