diff --git a/AUTHORS b/AUTHORS index fff33b2e..639b1e11 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,3 +40,4 @@ Frankie O'Rourke (https://github.com/psfrankie) Cody Mello (https://github.com/melloc) Todd Whiteman (https://github.com/twhiteman) Zach Bjornson (https://github.com/zbjornson) +Hamza Shaikh (https://github.com/hamzashaikhcan) diff --git a/lib/bunyan.js b/lib/bunyan.js index 405cdb24..6fcbf36a 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -238,7 +238,12 @@ var _warned = {}; function ConsoleRawStream() {} ConsoleRawStream.prototype.write = function (rec) { if (rec.level < INFO) { - console.log(rec); + try { + rec = JSON.parse(x); // Convert string to JSON + console.log(rec); // Log JSON Data + } catch (e) { + console.log(rec); // Log simple string + } } else if (rec.level < WARN) { console.info(rec); } else if (rec.level < ERROR) {