From b3a6904ba47085deb8d340ded5921eef5b865a31 Mon Sep 17 00:00:00 2001 From: MrBugHere <48257899+MrBugHere@users.noreply.github.com> Date: Tue, 5 Mar 2019 17:11:37 -0300 Subject: [PATCH] to set more atributes for the data base a proposal for a more customizable entry and actually works for me the childlogger of winston, by the way, why is the entry prepared in that way? --- lib/winston-mongodb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/winston-mongodb.js b/lib/winston-mongodb.js index ece4250..a802812 100644 --- a/lib/winston-mongodb.js +++ b/lib/winston-mongodb.js @@ -190,7 +190,7 @@ MongoDB.prototype.log = function(info, cb) { if (this.silent) { cb(null, true); } - let entry = {timestamp: new Date(), level: info.level}; + let entry = helpers.prepareMetaData(info); let message = util.format(info.message, ...(info.splat || [])); entry.message = this.decolorize ? message.replace(/\u001b\[[0-9]{1,2}m/g, '') : message; entry.meta = helpers.prepareMetaData(info.meta);