I am using forever to run my node application. When I start forever I specify where to write the logs. I also specify to append to the log. Problem here is that my log is going to grow out of control over the course of months.
Is there any way to archive/roll logs on an interval, i.e. every day roll/archive what is in the log file to another file (i.e. server-2013-3-5.log). That way I can delete/move off old log files as needed.
I have just started looking into using Winston for my logger and I have not come across anything there that would help.
Any ideas?
forever itself doesn't support log rotation and log rotation is still a pending feature request for Winston.
You can use
logrotate
which is included in most Linux distributions and is used for rotating system log files, as well as used by other software like Apache.Add a file to
/etc/logrotate.d/
See more
logrotate
examples.