rotatable
Subclass of fs.WriteStream that supports automatic file rotations, from multiple parallel processes. Only supports append mode.
Usage
var rotatable = ; // create a test.log file, and rotate it every 10mbvar stream = ;stream // pipe some data into the streamotherstream; // or - use it in a Moran log
rotatable( path [, options ] )
Creates and returns a new RotateStream with the same arguments.
options
is forwarded as is to the fs.WriteStream
constructor. It also supports the following properties:
- size number of bytes, or a parsable bytes-string, that indicates when the file should be rotated.
rotatable.RotateStream
RotateStream
is subclass of Node's fs.WriteStream.
Event: 'rotate'
- rotated the path to the rotated file
Emitted when the stream has finished rotating