diff --git a/app/middlewares/log.js b/app/middlewares/log.js index ea2c6c8f..d81b3e9a 100644 --- a/app/middlewares/log.js +++ b/app/middlewares/log.js @@ -9,7 +9,7 @@ module.exports = function log() { request: { sql: prepareSQL(res.locals.sql) } - } + }; res.set('X-SQLAPI-Log', stringifyForLogs(logObj, MAX_SQL_LENGTH)); @@ -25,16 +25,16 @@ function prepareSQL(sql) { if (typeof sql === 'string') { return { simple: sql.substring(0, MAX_SQL_LENGTH) - } + }; } if (Array.isArray(sql)) { return { multiple: sql.map(q => q.substring(0, MAX_SQL_LENGTH)) - } + }; } return { other: sql - } + }; } diff --git a/app/utils/logs.js b/app/utils/logs.js index 80366709..1ac3c0e4 100644 --- a/app/utils/logs.js +++ b/app/utils/logs.js @@ -11,7 +11,7 @@ module.exports = { stringifyForLogs(object, max_string_length = 1024) { return JSON.stringify(cloneAndFilter(object, max_string_length)); } -} +}; function cloneAndFilter(object, max_string_length) { if (!object || !(object instanceof Object)) { @@ -22,7 +22,7 @@ function cloneAndFilter(object, max_string_length) { Object.keys(object).map(key => { if (typeof object[key] === 'string') { - newObject[key] = filterString(object[key], max_string_length) + newObject[key] = filterString(object[key], max_string_length); } else if (typeof object[key] === 'object') { newObject[key] = cloneAndFilter(object[key], max_string_length); } else if (object[key] instanceof Array) {