Emit rotate events for log files based on interval. Rotate event handlers are called "rotator-tots" or just tots. Tots get passed a (readable stream, the log file path, and the data passed in when the log was asociated).
var rotator = ;
var tot = ;
- the rotate interval for all files on this tot defaults to 1 day
- the max size of the file before it is rotated. defauls to 5gb
- gzip = true
- rotated files are by default gzipped
- how often to check if any logs need to be rotated. defaults to 1 minute.
- how often to poll size. i did not want to install watchers because we should not really need to check this so often.
returns an EventEmitter
- remove a path from the rotate list
- creates day timestamp from UTC YMD overload this function to change the format.
- path the file path you want to rotate
- cb callback
- the file path that must not be rotated until stream close
- the stream that must close
- rotate(rs ReadabeStream,p file path, data)
- rotated(p file path,data)
- all active rotates are done
- rotate-error(err Error, p file path, data)
- rotate-empty(p path,data);
data objects are passed to events. this is the data associated with each file.
let me know if you have victory