diff --git a/api.js b/api.js index 6dae82c4..3b1257c0 100644 --- a/api.js +++ b/api.js @@ -184,7 +184,7 @@ server.use( }) ); -logger.token('user-ip', req => ((req.body && req.body.ip) || (req.query && req.query.ip)).toString().substr(0, 40) || '-'); +logger.token('user-ip', req => ((req.body && req.body.ip) || (req.query && req.query.ip) || '').toString().substr(0, 40) || '-'); logger.token('user-sess', req => (req.body && req.body.sess) || (req.query && req.query.sess) || '-'); logger.token('user', req => (req.user && req.user.toString()) || '-');