diff --git a/bin/tsw/util/auto-report/logReport.js b/bin/tsw/util/auto-report/logReport.js index 5f434903..40fae4aa 100644 --- a/bin/tsw/util/auto-report/logReport.js +++ b/bin/tsw/util/auto-report/logReport.js @@ -676,7 +676,7 @@ function reportLog() { res._body = Buffer.from(format.formatBuffer(res._body)); } - logJson = logJson || logger.getJson() || {}; + logJson = logJson || logger.getJson(isWebSocket) || {}; logJson.curr = { protocol: 'HTTP', host: req.headers.host, diff --git a/bin/tsw/util/logger/logger.js b/bin/tsw/util/logger/logger.js index b3d0acd5..16e0e84f 100644 --- a/bin/tsw/util/logger/logger.js +++ b/bin/tsw/util/logger/logger.js @@ -80,7 +80,7 @@ Logger.prototype = { contextMod.currentContext().log = null; }, - getJson: function() { + getJson: function(cleared) { const log = this.getLog(); let json = { curr: {}, @@ -97,6 +97,10 @@ Logger.prototype = { log.json = json; } + if (cleared) { + log.json = null; + } + return json; },