Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does forever store console.log output?

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?

like image 312
AGamePlayer Avatar asked Jan 09 '14 13:01

AGamePlayer


People also ask

What is a console log file?

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.

How does console log work in node?

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.

Can I console log from node module?

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.


2 Answers

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

like image 189
bryanmac Avatar answered Nov 15 '22 22:11

bryanmac


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.

like image 44
Liyan Chang Avatar answered Nov 15 '22 23:11

Liyan Chang