we are using node.js and winston to right out log files. we have a custom log rotation script written in PHP that we would like to use on those log files. but the script just moves the file which doesn't work in this case since winston has an open stream on that file.
how can i move a winston log file using PHP so winston knows to create a new log file once i move it?
A solution to this is provided here.
Add a maxsize: [bytes]
to the file: {}
section and it will automatically rotate the logs (appending a # to the file name, ie woot.log
becomes woot1.log
when it fills up).