I am running my node project using Forever on a Amazon CentOS EC2 instance using the following command:
forever start -o /home/ec2-user/logs/www.log -e /home/ec2-user/logs/www.err app.js
My application runs properly but there are no www.log or www.err files created in the logs directory. I tried manually creating these files and setting chmod 777, and still, there is no data logged to these files. I am certain that there should be data logging; I am running the same project in a similar environment and everything is logging OK. Any help is appreciated!
js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.
Forever is an npm module that ensures a Node. js script continuously runs in the background on the server. It's a helpful CLI tool for the production environment because it helps manage the Node applications and their processes.
I think there was a breaking change in one of the more recent node releases. Someone recently filed a related issue on GitHub: https://github.com/nodejitsu/forever/issues/193
Unfortunately Forever seems to output child process error messages to stdout, so redirecting stderr to a file doesn't work. A temporary workaround would be to use an older version of node. Hopefully a fix will be out soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With