From ee6f5f1c963c49850c11a931bbd7ce3152ec0632 Mon Sep 17 00:00:00 2001 From: Jakub Matejka Date: Wed, 29 Nov 2017 12:11:20 +0100 Subject: [PATCH] :bug: Add requestId to event if missing --- package.json | 2 +- src/logger.handler.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 60bf6cb..b7ba568 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@keboola/serverless-papertrail-logging", - "version": "1.0.7", + "version": "1.0.8", "description": "Serverless plugin for log delivery from CloudWatch Logs to Papertrail using a lambda function with log groups subscription", "main": "src/index.js", "repository": "https://github.com/keboola/serverless-papertrail-logging", diff --git a/src/logger.handler.js b/src/logger.handler.js index cd400f3..433ed03 100644 --- a/src/logger.handler.js +++ b/src/logger.handler.js @@ -13,8 +13,8 @@ const formatLog = (level, message) => { if (_.has(logData.event, 'body') && _.isString(logData.event.body)) { logData.event.body = JSON.parse(logData.event.body); } - if (!_.has(logData, 'requestId')) { - logData.requestId = consoleLog[1]; + if (!_.has(logData, 'event.requestId')) { + logData.event.requestId = consoleLog[1]; } return JSON.stringify(logData); } catch (e) {