Skip to content

Commit

Permalink
fixes #125 by also checking for gz filename before deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 authored and Matt Berther committed Jan 3, 2020
1 parent 3aa18f8 commit e504c13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions daily-rotate-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ var DailyRotateFile = function (options) {
});

this.logStream.on('logRemoved', function (params) {
if (options.zippedArchive) {
var gzName = params.name + '.gz';
if (fs.existsSync(gzName)) {
fs.unlinkSync(gzName);
self.emit('logRemoved', gzName);
return;
}
}
self.emit('logRemoved', params.name);
});

Expand Down

0 comments on commit e504c13

Please sign in to comment.