Skip to content

Commit 7c2318f

Browse files
author
Stefan Heine
committed
Update documentation for new options.
1 parent 35b8439 commit 7c2318f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
winston.add(require('winston-daily-rotate-file'), options)
1111
```
1212

13-
The DailyRotateFile transport can rotate files by minute, hour, day, month or year. In addition to the options accepted by the File transport, the Daily Rotate File Transport also accepts the following options:
13+
The DailyRotateFile transport can rotate files by minute, hour, day, month, year or weekday. In addition to the options accepted by the File transport, the Daily Rotate File Transport also accepts the following options:
1414

15-
* __datePattern:__ A string representing the pattern to be used when appending the date to the filename (default '.yyyy-MM-dd'). The meta characters used in this string will dictate the frequency of the file rotation. For example, if your datePattern is simply '.HH' you will end up with 24 log files that are picked up and appended to every day.
16-
* __prepend:__ Defines if the rolling time of the log file should be prepended at the begging of the filename (default `false`)
15+
* __datePattern:__ A string representing the pattern to be used when appending the date to the filename (default 'yyyy-MM-dd'). The meta characters used in this string will dictate the frequency of the file rotation. For example, if your datePattern is simply 'HH' you will end up with 24 log files that are picked up and appended to every day.
16+
* __prepend:__ Defines if the rolling time of the log file should be prepended at the beginning of the filename (default 'false').
17+
* __fileSuffix:__ Defines a suffix to add to the filename (eg 'log'). Allows putting the 'datePattern' between filename and suffix (eg 'error.Thu.log').
18+
19+
The log file name, consisting of 'filename', 'datePattern' and 'fileSuffix' are joined by '.'.
1720

1821
Valid meta characters in the datePattern are:
1922

@@ -27,6 +30,7 @@ Valid meta characters in the datePattern are:
2730
* __HH:__ The zero padded hour.
2831
* __m:__ The minute.
2932
* __mm:__ The zero padded minute.
33+
* __ddd:__ The weekday (Mon, Tue, ..., Sun).
3034

3135
*Metadata:* Logged via util.inspect(meta);
3236

0 commit comments

Comments
 (0)