I installed forever and am using it, finding it quite funny.
But I realized that the logs are placed to somewhere else. Is there any tips?
console. log specifically is a method for developers to write code to inconspicuously inform the developers what the code is doing. It can be used to alert you that there's an issue, but shouldn't take the place of an interactive debugger when it comes time to debug the code.
log() function from console class of Node. js is used to display the messages on the console. It prints to stdout with newline. Parameter: This function contains multiple parameters which are to be printed.
You can put console logs but just remember to restart the server. Hot reload does not detect changes in dist folders of libraries in node_modules.
Forever takes command line options for output:
-l LOGFILE Logs the forever output to LOGFILE -o OUTFILE Logs stdout from child script to OUTFILE -e ERRFILE Logs stderr from child script to ERRFILE
For example:
forever start -o out.log -e err.log my-script.js
See here for more info
Forever, by default, will put logs into a random file in ~/.forever/
folder.
You should run forever list
to see the running processes and their corresponding log file.
Sample output
>>> forever list info: Forever processes running data: uid command script forever pid logfile uptime data: [0] 6n71 /usr/bin/node app.js 2233 2239 /home/vagrant/.forever/6n71.log 0:0:0:1.590
However, it's probably best to specify with -l
as mentioned by bryanmac.
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