log-rotate
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/log-rotate package

0.2.8 • Public • Published

log-rotate

Rotate a log similar to the way linux logrotate does, appending and updating .NUM indexes as you go.

Build Status
NPM

Example

var rotate = require('log-rotate');
  
// move a log file while incrementing existing indexed / rotated logs
rotate('./test.log', function(err) {
  // ls ./ => test.log test.log.0
});

options

count

Limit the number of rotated files to count

var rotate = require('log-rotate');
 
rotate('./test.log', { count: 3 }, function(err) {
  // ls ./ => test.log test.log.0 test.log.1
});

compress

Compress rotated files with gzip

install

With npm do:

npm install log-rotate

Readme

Keywords

Package Sidebar

Install

npm i log-rotate

Weekly Downloads

6,531

Version

0.2.8

License

BSD-2-Clause

Unpacked Size

7.95 kB

Total Files

7

Last publish

Collaborators

  • dstokes