adding a timestamp

This commit is contained in:
Martin Donnelly 2016-12-22 16:01:24 +00:00
parent 958e544024
commit fd3ebb914f
2 changed files with 3 additions and 1 deletions

View File

@ -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",

View File

@ -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');