Get the stdout of a droplet

Is there a way to access the stdout of droplets? I started running a node.js script that was running fine on a different host, virtually as-is, but is crashing on my DO droplet. When I access the console for the droplet, it is wiped clean, and the logs that went to stdout is no longer there.

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.

Site Moderator
Site Moderator badge
February 8, 2023

Hello @undetected

You can modify the script to log the output in a file if the server logs do not contain information about what went wrong.

Keep in mind that the logs might have passed rotation so you can check all the log files on the server even the compressed archives.


Site Moderator
Site Moderator badge
February 8, 2023

Hi @undetected,

You can start the process in Screen and and follow it to see where it crashes.

Additionally, if you are using PM2 you can configure loging as well. It’s not also strange that your logs are empty. Check your /var/log folder for your application’s logs.

Check this here -

It’s how ot use pm2 with nodejs, should be helpful.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.