diff --git a/lib/winston/transports/file.js b/lib/winston/transports/file.js index 99682453b..a6ee2db85 100644 --- a/lib/winston/transports/file.js +++ b/lib/winston/transports/file.js @@ -439,9 +439,7 @@ module.exports = class File extends TransportStream { this._dest = this._createStream(this._stream); this._opening = false; this.once('open', () => { - if (this._stream.eventNames().includes('rotate')) { - this._stream.emit('rotate'); - } else { + if (!this._stream.emit('rotate')) { this._rotate = false; } });