Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
NodeJS file stream rotator

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
FileStreamRotator.js
README.md
index.js
package.json
test.js

README.md

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.

Something went wrong with that request. Please try again.