0

I'm running a node app via a shell script

#STARTUP.sh
node server.js

#/etc/rc.local  - this runs on startup of my machine
sudo sh startup.sh >> /home/pi/logs/app.log 2>&1

My issue is, when I have an error in my node app it just crashes and doesn't write the error to app.log

Is there a way to make sure when the app crashes that the error gets logged as well?

3

1 Answer 1

1

Replace the last line with this:

sudo sh startup.sh &>>/home/pi/logs/app.log
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.