A rolling file appender for the logging library winston for node.js
JavaScript
Latest commit 55305ad May 8, 2016 @mallocator Added travis config

README.md

Winston-Rolling-File-Appender

npm version Build Status Coverage Status Dependency Status

A rolling file transport for the logging library winston for node.js. This transport has been modified from the original transport to create a log file for each day.

If configured with my.log as filename, the generated files will be for example:

my.2012-08-01.log
my.2012-08-02.log
my.2012-08-03.log
...
my.2012-08-10.log
my.log ( -> symbolic link to latest log file)

The transport has been used and tested on linux machines. No idea if this works on windows.

Usage

var winston = require('winston');
require('rolling-file-transport');

winston.loggers.add('myLogger', {
    rollingFile : {
        filename : '/path/to/my/filename.log',  // files will use filename.<date>.log for all files 
        level : 'info',                         // Set your winston log level, same as original file transport
        timestamp : true,                       // Set timestmap format/enabled, Same ass original file transport
        maxFiles : 10,                          // How many days to keep as back log
        json : false                            // Store logging data ins json format
    }
});

Install

npm install --save rolling-file-transport