file-stream-rotator

Automated stream rotation

file-stream-rotator

NodeJS file stream rotator

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

npm install file-stream-rotator
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

The npm module for this library is maintained by:

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