/winston-daily-rotate-file

A transport for winston which logs to a rotating file each day.

Primary LanguageJavaScriptMIT LicenseMIT

winston-daily-rotate-file

SEEKING NEW MAINTAINER

I will be continuing work on winston itself with gusto, but do not plan on spending cycles on maintaining this transport. This was the primary motivation for breaking it out from the core in winston@2.0.0. If you are interested please let me know in the tracking Github issue.

Usage

A transport for winston which logs to a rotating file each day.

  winston.add(require('winston-daily-rotate-file'), options)

The DailyRotateFile transport can rotate files by minute, hour, day, month or year. Its options are identical to the File transport with the lone addition of the 'datePattern' option:

  • 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.

Valid meta characters in the datePattern are:

  • yy: Last two digits of the year.
  • yyyy: Full year.
  • M: The month.
  • MM: The zero padded month.
  • d: The day.
  • dd: The zero padded day.
  • H: The hour.
  • HH: The zero padded hour.
  • m: The minute.
  • mm: The zero padded minute.

Metadata: Logged via util.inspect(meta);

LICENSE: MIT
AUTHOR: Charlie Robbins