From fd3ebb914fd0a1fcb4b65afeb90de7c80c423c7b Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Thu, 22 Dec 2016 16:01:24 +0000 Subject: [PATCH] adding a timestamp --- package.json | 1 + server/loggerhandler.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 687f4d1..53bd648 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "cookie-parser": "^1.4.1", "ejs": "^2.4.1", "express": "^4.13.4", + "googleapis": "^15.0.0", "markdown": "^0.5.0", "morgan": "^1.7.0", "nano": "^6.2.0", diff --git a/server/loggerhandler.js b/server/loggerhandler.js index 517e60c..725021d 100644 --- a/server/loggerhandler.js +++ b/server/loggerhandler.js @@ -43,7 +43,8 @@ var dbCloudant = cloudant.db.use(credentials.database); function insertLog(obj) { logger.debug('Inserting into couch...'); logger.info(util.inspect(obj)); - var newObj = {body:obj}; + var ts = new Date(); + var newObj = {body:obj, timestamp:ts}; dbCloudant.insert(newObj, function(err, body,header) { if (err) { logger.error('Error inserting into couch');