File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Create a bunyan logger using the stream:
20
20
stream: new RotatingFileStream ({
21
21
path: ' /var/log/foo.log' ,
22
22
period: ' 1d' , // daily rotation
23
- totalFiles: 10 , // keep up to 10 back copies
23
+ totalFiles: 10 , // keep up to 10 backup copies
24
24
rotateExisting: true , // Give ourselves a clean file when we start up, based on period
25
25
threshold: ' 10m' , // Rotate log files larger than 10 megabytes
26
26
totalSize: ' 20m' , // Don't keep more than 20mb of archived log files
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ class FileRotator extends EventEmitter {
124
124
try {
125
125
const result = await fs . stat ( name ) ;
126
126
bytesTotal += result . size ;
127
- if ( ( this . _totalSize && bytesTotal > this . _totalSize ) || ( this . _totalFiles && fileNumber + 1 > this . _totalFiles ) ) {
127
+ if ( ( this . _totalSize && bytesTotal > this . _totalSize ) || ( this . _totalFiles && fileNumber > this . _totalFiles ) ) {
128
128
filesToDelete . push ( name ) ;
129
129
}
130
130
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments