From 130c7c8cfff26068aa087d9ba61c4446757a0fc8 Mon Sep 17 00:00:00 2001 From: Tarcisio Gruppi Date: Wed, 2 Oct 2019 20:02:13 -0300 Subject: [PATCH] Add default metadata when calling log with string level and message --- lib/winston/logger.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/winston/logger.js b/lib/winston/logger.js index 4f0095c25..9f4044516 100644 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -220,7 +220,9 @@ class Logger extends Transform { return this; } - this.write({ [LEVEL]: level, level, message: msg }); + msg = { [LEVEL]: level, level, message: msg }; + this._addDefaultMeta(msg); + this.write(msg); return this; }