Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using supervisor to start my node.js application on a micro EC2 instance. However, the app only stays running for some time until it eventually shuts down. Not exactly sure how long the app stays running but I'm guessing for about a few hours or so. Sometimes less. My question is where on the remote server should I be looking in order to debug this kind of issue? I'm running an Amazon Linux AMI.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can try to get node log using this supervisord configuration. After a crash, you will get what really happened. Provably the error might be because node crash for some unexpected error. Try to use console.logs

 ; ------- NODE -------
 [program:node]
 command=/usr/local/bin/node app.js
 directory=/var/www/node
 environment=NODE_ENV=production
 user=root
 stdout_logfile=/var/log/node/node.log
 stderr_logfile=/var/log/node/node.error
 serverurl=AUTO
 ; ---- END NODE CONFIG ----
share|improve this answer
    
Thanks! Do you think the relevant information would show up in the stdout file or stderr file? –  Justin Meltzer Jun 9 '12 at 20:25
    
yes sure! I think you will have some route you're accessing or your code enters in infinite loop. Try it and edit your post with your stderr. –  enedebe Jun 10 '12 at 14:53
    
Actually I used the supervisor you suggested and the site now is staying up! –  Justin Meltzer Jun 10 '12 at 15:57
1  
Great! But remember you still have a bug ;) you are just hiding it. Try to find where your scripts die. –  enedebe Jun 20 '12 at 9:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.