Pergunta

I am using forever (https://github.com/nodejitsu/forever) to run my nodejs application:

forever start app.js

However, it is creating HUGE log files. After 2 days, I have 8GB of logs. The logs are all stored in /home/.forever

Is it possible to turn of the logging feature from the command line, or should I edit my app somehow?

Foi útil?

Solução

console.log() writes to the standard output of your process (stdout), so you can tell forever to store the output of stdout in /dev/null:

$ forever -o /dev/null index.js

Outras dicas

Paul's answer did not work for me, but gave me some pointers on how to do it:

forever start -o /dev/null -l /dev/null -a script.js

From the documentation:

-l  LOGFILE      Logs the forever output to LOGFILE
-o  OUTFILE      Logs stdout from child script to OUTFILE

Depending on your process, you may also need to redirect STDERR:

-e  ERRFILE      Logs stderr from child script to ERRFILE
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top