diff --git a/lib/rotatingfilestream.js b/lib/rotatingfilestream.js index 354f3b3..b32c786 100644 --- a/lib/rotatingfilestream.js +++ b/lib/rotatingfilestream.js @@ -33,9 +33,6 @@ function RotatingFileStream(options) { var shared = options.shared; var rotator = FileRotator(path, totalFiles, totalSize, gzip); - rotator.on('gzip_finish', function(zippedPath) { - base.emit('gzip_finish', zippedPath); - }); var stream = null; var streambytesWritten = 0; @@ -185,6 +182,10 @@ function RotatingFileStream(options) { writeQueue.resume(); }); + rotator.on('gzip_finish', function(zippedPath) { + base.emit('gzip_finish', zippedPath); + }); + function initialise() { rotator.initialise(options.startNewFile, function (err) { if (err) {