Skip to content

Commit 4162f3b

Browse files
committed
Updated README.md for clarity for <=2.2.4
1 parent 8cd42a0 commit 4162f3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The streams behave the same as standard node.js streams, except that when certai
1717
### new RollingFileStream(filename [, maxSize, numBackups, options])
1818
* `filename` (String)
1919
* `maxSize` - the size in bytes to trigger a rollover, if not provided this defaults to MAX_SAFE_INTEGER and the stream will not roll.
20-
* `numBackups` - the number of old files to keep
20+
* `numBackups` - the number of old files to keep (excluding the hot file)
2121
* `options` - Object
2222
* `encoding` - defaults to 'utf8'
2323
* `mode` - defaults to 0644
@@ -51,7 +51,7 @@ When filename size >= maxSize then:
5151
* `compress` - (boolean) compress the backup files, defaults to false
5252
* `keepFileExt` - (boolean) defaults to `false` - keep the file original extension. e.g.: `abc.log -> abc.2013-08-30.log`.
5353
* `alwaysIncludePattern` - (boolean) extend the initial file with the pattern, defaults to false
54-
* `daysToKeep` - (integer) if this is greater than 0, then files older than `daysToKeep` days will be deleted during file rolling.
54+
* `daysToKeep` - (integer) the number of old files that matches the pattern to keep (excluding the hot file)
5555

5656

5757
This returns a `WritableStream`. When the current time, formatted as `pattern`, changes then the current file will be renamed to `filename.formattedDate` where `formattedDate` is the result of processing the date through the pattern, and a new file will begin to be written. Streamroller uses [date-format](http://github.com/nomiddlename/date-format) to format dates, and the `pattern` should use the date-format format. e.g. with a `pattern` of `".yyyy-MM-dd"`, and assuming today is August 29, 2013 then writing to the stream today will just write to `filename`. At midnight (or more precisely, at the next file write after midnight), `filename` will be renamed to `filename.2013-08-29` and a new `filename` will be created. If `options.alwaysIncludePattern` is true, then the initial file will be `filename.2013-08-29` and no renaming will occur at midnight, but a new file will be written to with the name `filename.2013-08-30`.

0 commit comments

Comments
 (0)