My node application keeps crashing, how do I debug the problem?

Something is causing my node application to crash. It is a twitter bot and does a fair amount of tweet parsing to extract images from the tweet, etc. There are many spots in the code where it could be failing, but very hard to guess.

There are multiple console.log’s which should be outputting to somewhere.

Where can I access node logs to see how my app is failing?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Because each node.js app is a separate entity, there are not logs for the framework itself. By default your errors will go to STDERR and output to STDOUT.

If you’d like to change to log to a file, you’ll need to run your app with a command like this:

node my_app.js > my_app_log.log 2> my_app_err.log