Logger: rename key 'msg' => 'event_message'

This commit is contained in:
Daniel García Aubert 2020-07-23 14:01:34 +02:00
parent d5c5d07507
commit 28f70f6877
3 changed files with 4 additions and 3 deletions

View File

@ -239,7 +239,8 @@ function createTemplateMaps ({ redisPool, surrogateKeysCache, logger }) {
return logger.error({ exception: err, 'cdb-user': user, template_id: templateName }, 'Named map invalidation failed'); return logger.error({ exception: err, 'cdb-user': user, template_id: templateName }, 'Named map invalidation failed');
} }
logger.info({ 'cdb-user': user, template_id: templateName, duration: (Date.now() - startTime) / 1000 }, 'Named map invalidation success'); const elapsed = Date.now() - startTime;
logger.info({ 'cdb-user': user, template_id: templateName, duration: elapsed / 1000, duration_ms: elapsed }, 'Named map invalidation success');
}); });
} }

View File

@ -22,7 +22,7 @@ module.exports = function profiler (options) {
req.profiler.done('response'); req.profiler.done('response');
req.profiler.end(); req.profiler.end();
const stats = req.profiler.toJSON(); const stats = req.profiler.toJSON();
logger.info({ stats, duration: stats.response / 1000 }, 'Request profiling stats'); logger.info({ stats, duration: stats.response / 1000, duration_ms: stats.response }, 'Request profiling stats');
try { try {
// May throw due to dns, see: http://github.com/CartoDB/Windshaft/issues/166 // May throw due to dns, see: http://github.com/CartoDB/Windshaft/issues/166

View File

@ -24,7 +24,7 @@ module.exports = class Logger {
return { levelname: label }; return { levelname: label };
} }
}, },
messageKey: 'message', messageKey: 'event_message',
timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`, timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`,
serializers: { serializers: {
client_request: requestSerializer, client_request: requestSerializer,