Spring Fresh Sale! - Up To 67% OFF BDIX Hosting + Free Domain
Node.js

How to View Logs and Fix a Failing Node.js App on Webuzo

When a Node.js app fails on Webuzo, the answer is almost always in the logs — your app's own output via PM2, plus OpenLiteSpeed's logs for proxy issues. Knowing where each lives turns a mysterious failure into a quick fix.

Your app's logs via PM2

Since you run the app under PM2, its output and errors are captured there. Over SSH:

pm2 logs myapp

This streams your app's console output and stack traces — the first place to look for a crash or runtime error. pm2 status shows whether the app is running or repeatedly restarting.

OpenLiteSpeed logs

If the app runs but the domain shows an error (like a 502), the problem is often the reverse proxy. Check OpenLiteSpeed's error logs, and confirm the proxy points at the correct local port — see running Node behind OpenLiteSpeed.

Common causes and fixes

  • App crashing on start — read the PM2 logs for the error (a missing module, a bad database connection, a missing environment variable), fix it, and restart.
  • App up but domain errors — a reverse-proxy or port mismatch; align the proxy target with the app's port.
  • App keeps restarting — an error is crashing it on a loop; the PM2 logs show why. Add proper error handling.
  • Repeated failures under load — check for memory leaks.

Add your own logging

For clearer diagnostics, add structured logging so you record what your app is doing, not just when it crashes.

Frequently asked questions

Where are my Node app's logs on Webuzo?

PM2 captures them — run pm2 logs to see your app's output and errors. For proxy-level problems, also check OpenLiteSpeed's error logs.

My app works but the domain shows 502.

That points to the reverse proxy — the app may be down or the proxy is aimed at the wrong port. Confirm the app is running under PM2 and that the proxy target matches its local port.

The app keeps restarting in PM2.

It is crashing on an error each time. Read pm2 logs to find the exception, fix the cause, and add error handling so one fault does not crash the whole app.

Was this article helpful?