In my project there was a requirement to rotate logs at 4:00 AM every morning. As you know, It is a common use-case to rotate the logs. So I implemented the same and committing it back to repository. Please go through the changes I've made and see if it can be merged along with your master (w/ or w/o modifications).
I have modified the Readme & also added an example of how to make use of this feature at: https://github.com/thakkar-rushikesh/log.js/blob/master/examples/file-rotate.js.
Please review and provide your suggestions if any.
Adding log-rotation feature, based on maximum number of lines to be w…
…ritten before rotating the logs.
Implemented Date-based rotation.
Added support for time based log rotation. Logs will rotate at the ti…
…me specified in 24 hours format.
Refactored constructor, Added api-doc comments.
Adding extra condition to restrict initializing rotation.
Example/demonstration of log-file rotation.
Sorry, I didn't get you.
If you are suggesting to use Linux's logrotate command, then let me tell you I already tried it. It doesn't work, because of some issue with file-handle. Moreover, logrotate is not available on all the flavours of Linux, even if we ignore Windows.
different lib or tool