| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gavin/workspace/readjs/node_modules/file-stream-rotator/ |
Upload File : |
####NOTE: This project is no longer maintained. If you're interested in taking ownership, please contact us####
file-stream-rotator
===================
[](https://codeclimate.com/github/holidayextras/file-stream-rotator)
[](https://travis-ci.org/holidayextras/file-stream-rotator)
NodeJS file stream rotator
## Purpose
To provide an automated rotation of Express/Connect logs based on date.
## Install
```
npm install file-stream-rotator
```
## Usage
# Default date added at the end of the file
var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test.log", frequency:"daily", verbose: false});
# Default date added using file pattern
var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test-%DATE%.log", frequency:"daily", verbose: false});
# Custom date added using file pattern using moment.js formats
var rotatingLogStream = require('file-stream-rotator').getStream({filename:"/tmp/test-%DATE%.log", frequency:"daily", verbose: false, date_format: "YYYY-MM-DD"});
.....
// 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:
* [Dan Jenkins](http://github.com/danjenkins)
* [Roger Castells](http://github.com/rogerc)
* [Viktor Trako](http://github.com/viktort)
## License
file-stream-rotator is licensed under the MIT license.