Skip to content

Commit 0f1ae73

Browse files
author
Matt Berther
committed
emit archive event after gzipping
1 parent 2741162 commit 0f1ae73

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The DailyRotateFile transport can rotate files by minute, hour, day, month, year
5151
logger.info('Hello World!');
5252
```
5353

54-
You can listen for the *rotate* custom event. The rotate event will pass two parameters to the callback (*oldFilename*, *newFilename*).
54+
You can listen for the *rotate* custom event. The rotate event will pass two parameters to the callback (*oldFilename*, *newFilename*). You can also listen for the *archive* custom event. The archive event will pass one parameter to the callback (*zipFilename*).
5555

5656
## LICENSE
5757
MIT

daily-rotate-file.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ var DailyRotateFile = function (options) {
107107
var out = fs.createWriteStream(oldFile + '.gz');
108108
inp.pipe(gzip).pipe(out).on('finish', function () {
109109
fs.unlinkSync(oldFile);
110+
self.emit('archive', oldFile + '.gz');
110111
});
111112
});
112113
}

0 commit comments

Comments
 (0)