From c6d45f9e40bcbcda1b04b1a7d1064455d8408d95 Mon Sep 17 00:00:00 2001 From: Roman Stetsyshin Date: Thu, 16 Jul 2015 17:35:28 -0700 Subject: [PATCH] Fixed event subscription on close We should listen to 'finish' event from stream to close transport. --- lib/winston/transports/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/winston/transports/file.js b/lib/winston/transports/file.js index b60fb9269..cec2c3106 100644 --- a/lib/winston/transports/file.js +++ b/lib/winston/transports/file.js @@ -394,7 +394,7 @@ File.prototype.close = function () { this._stream.end(); this._stream.destroySoon(); - this._stream.once('drain', function () { + this._stream.once('finish', function () { self.emit('flush'); self.emit('closed'); });