You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DailyRotateFile transport can rotate files by minute, hour, day, month, year or weekday. In addition to the options accepted by the logger, `winston-daily-rotate-file` also accepts the following options:
19
19
20
20
***frequency:** A string representing the frequency of rotation. This is useful if you want to have timed rotations, as opposed to rotations that happen at specific moments in time. Valid values are '#m' or '#h' (e.g., '5m' or '3h'). Leaving this null relies on `datePattern` for the rotation times. (default: null)
21
-
***datePattern:** A string representing the [moment.js date format](http://momentjs.com/docs/#/displaying/format/) to be used for rotating. 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. (default 'YYYY-MM-DD')
22
-
***zippedArchive:** A boolean to define whether or not to gzip archived log files. (default 'false')
21
+
***datePattern:** A string representing the [moment.js date format](http://momentjs.com/docs/#/displaying/format/) to be used for rotating. 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. (default: 'YYYY-MM-DD')
22
+
***zippedArchive:** A boolean to define whether or not to gzip archived log files. (default: 'false')
23
23
***filename:** Filename to be used to log to. This filename can include the `%DATE%` placeholder which will include the formatted datePattern at that point in the filename. (default: 'winston.log.%DATE%)
24
24
***dirname:** The directory name to save log files to. (default: '.')
25
25
***stream:** Write directly to a custom stream and bypass the rotation capabilities. (default: null)
@@ -56,10 +56,10 @@ The DailyRotateFile transport can rotate files by minute, hour, day, month, year
56
56
57
57
This transport emits the following custom events:
58
58
59
-
**new*: fired when a new log file is created. This event will pass one parameter to the callback (*newFilename*).
60
-
**rotate*: fired when the log file is rotated. This event will pass two parameters to the callback (*oldFilename*, *newFilename*).
61
-
**archive*: fired when the log file is archived. This event will pass one parameter to the callback (*zipFilename*).
62
-
**logRemoved*: fired when a log file is removed from the file system. This event will pass one parameter to the callback (*removedFilename*).
59
+
***new**: fired when a new log file is created. This event will pass one parameter to the callback (*newFilename*).
60
+
***rotate**: fired when the log file is rotated. This event will pass two parameters to the callback (*oldFilename*, *newFilename*).
61
+
***archive**: fired when the log file is archived. This event will pass one parameter to the callback (*zipFilename*).
62
+
***logRemoved**: fired when a log file is removed from the file system. This event will pass one parameter to the callback (*removedFilename*).
0 commit comments