suppress some routine server logs

This commit is contained in:
ansuz 2020-02-10 09:03:16 -05:00
parent 7f22da0f57
commit 68a77885d4
1 changed files with 3 additions and 0 deletions

View File

@ -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,