Skip to content

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

Notifications You must be signed in to change notification settings

HeikoR/winston-filerotatedate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%