file-stream-rotator

Automated stream rotation

npm install file-stream-rotator
4 downloads in the last day
14 downloads in the last week
59 downloads in the last month

file-stream-rotator

Code Climate

NodeJS file stream rotator

Purpose

To provide an automated rotation of Express/Connect logs based on date.

Install

npm install file-stream-rotator

Usage

var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test.log", frequency:"daily", verbose: false});
.....
// Use new stream in express
app.use(express.logger({stream: rotatingLogStream, format: "default"}));
.....
frequency options include:
* daily
* rotate on given minutes using the 'm' option i.e. 5m or 30m
** var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test.log", frequency:"5m", verbose: false});
* rotate on the hour or any specified number of hours
** var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test.log", frequency:"1h", verbose: false});
* test - creates a log file with a date suffix

NPM Maintainers

The npm module for this library is maintained by:

License

file-stream-rotator is licensed under the MIT license.

npm loves you