Search code examples
node.jsloggingdebiansyslogforever

Forever is truncating logs


I've been using forever for a long time but recently it started to behave a little bit weird: everything is ok except for the logs.

I used to run forever start /path/to/app.js and everything was fine. Even for huge logs (1-2 gigs).

But I currently have an app, a very busy web app and the log is being truncated every 3-4 hours. The size is not that big, 80-120 megs actually.

After realising this I decided to try (unsuccessfully though) starting forever with options: forever --append -o /path/to/out.log -e /path/to/error.log start /path/to/app.js but the problem persists.

I really don't know what to do. Any thoughts?? Thanks!!

Versions:

  • node v0.12.7
  • npm 2.11.3
  • forever v0.15.1
  • 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU/Linux

UPDATE1:

  • BTW: I have plenty of hard disk an memory available

UPDATE2:

I found a related Issue (https://github.com/foreverjs/forever/issues/106#issuecomment-116933382) and beging testing with the following command: forever -a -l >(logger -t fileteTrackchile) start /path/to/app.js So far so good, but it will store log information in /var/log/user.log, /var/log/syslog and /var/log/messages. It's the same information so it would be better to save it only once.

I'll leave it running for a couple of days and see if it works or not.

UPDATE3 (FINAL):

The problem had nothing to do with forever, nor winston. I didn't realise that the files were so big that the log viewer was only showing part of it. The confusing part is that the first line (past) was truncated by the viewer (OSX Console) what led me to think that the file itself was truncated.


Solution

  • The problem had nothing to do with forever, nor winston. I didn't realise that the files were so big that the log viewer was only showing part of it. The confusing part is that the first line (past) was truncated by the viewer (OSX Console) what led me to think that the file itself was truncated.