co-logfile
A log file util that can split log file by day/hour/filesize.
Install
npm install co-logfile
Usage
- new Logger(path, opt) # log filename will be path + logfile info + '.log'
- logger.write(msg) # msg can be a string or an object.
- logger.coWrite(msg) # For co, you can write code like: yield logger.cowrite('blabla'); If there are too many logs to write, this may help.
var Logger = ; var shlog = 'sfoo' splitBy: hour: true size: 512 ; // Split by hour & filesize 512var hlog = 'foo' splitBy: hour: true ; // Split by hourvar dlog = 'bar'; // Split by day. ;