I have a cluster of production servers running a Node.JS app via Forever. As far as I can tell, my options for log files are as follows:
- Let Forever do it on its own, in which case it will log to ~/.forever/XXXX.log
- Specify one specific log file for the entire life of the process
What I’d like to do, however, is have it log to a different file every day. eg. 20121027.log, 20121028.log, etc.
Is this possible? If so, how can it be done?
You may use some linux program like
logrotateto help you w/ log rotation.People use logrotate to rotate logs for things like apache, etc.
The config file is usually under /etc/logrotate.d
man logratatecan give you more information, and here is a great tutorial: http://www.thegeekstuff.com/2010/07/logrotate-examples/