diff --git a/lib/winston/transports/console.js b/lib/winston/transports/console.js index ee5bcf9c5..da7f24523 100644 --- a/lib/winston/transports/console.js +++ b/lib/winston/transports/console.js @@ -28,6 +28,7 @@ var Console = exports.Console = function (options) { this.timestamp = typeof options.timestamp !== 'undefined' ? options.timestamp : false; this.label = options.label || null; this.logstash = options.logstash || false; + this.debugStdout = options.debugStdout || false; if (this.json) { this.stringify = options.stringify || function (obj) { @@ -76,7 +77,7 @@ Console.prototype.log = function (level, msg, meta, callback) { logstash: this.logstash }); - if (level === 'error' || level === 'debug') { + if (level === 'error' || (level === 'debug' && !this.debugStdout) ) { process.stderr.write(output + '\n'); } else { process.stdout.write(output + '\n');