Skip to content
File logger with rotation of log files using the current date + (a-z). Latest file is always the default log file
JavaScript
Find file

README.md

winston-filerotatedate

File transport for winston that allows the log files to be rotated depending on size and time.

File Rotate Date Transport

  winston.add(winston.transports.FileRotateDate, options)

The File transport accepts a filename via the 'filename' option and uses that file as the primary logging target. Should the file grow past 'maxsize' bytes then the current log file is renamed and a new primary log tile is created. The name of the renamed log file is formated as such 'basenameYYYYMMDD[a-z].bak'.

Available options are:

  • level: Level of messages that this transport should log.
  • silent: Boolean flag indicating whether to suppress output.
  • timestamp: Boolean flag indicating if we should prepend output with timestamps (default true). If function is specified, its return value will be used instead of timestamps.
  • filename: The filename of the logfile to write output to.
  • dirname: The folder the logfile will be created in.
  • maxsize: Max size in bytes of the logfile, if the size is exceeded then a new file is created.
  • json: If true, messages will be logged as JSON (default true).

Metadata: Logged via util.inspect(meta);

Something went wrong with that request. Please try again.