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

How to View Node.js Application Logs and Errors in cPanel

When a Node.js app on cPanel fails or behaves oddly, its logs record what happened — and reading them is the fastest way to a fix. There are a few places to look, depending on the type of problem.

The app's own error output

Passenger captures your app's error output (stderr) to a log file, typically named something like stderr.log in your application folder. This is where startup crashes and runtime errors appear — the first place to check for an app that will not start or is throwing errors. View it in File Manager or over SSH.

cPanel's error logs

cPanel's Errors tool and your account's error logs capture web-server-level errors, which can help when requests fail before reaching your app — related to viewing the error log in cPanel.

Add your own logging

Do not rely only on crash output — add structured logging so you record what your app is doing, not just when it fails. See structured logging with Pino or Winston. Log meaningful events and errors with context so problems are easy to trace.

How to use the logs

  1. Reproduce the problem.
  2. Open the app's stderr log and read the most recent entries.
  3. Find the error message and stack trace — it usually names the file and line.
  4. Fix the cause, restart, and re-check the log.

Frequently asked questions

Where is my Node app's error log?

Passenger writes your app's stderr to a log file (often stderr.log) in the application folder. That is the main place startup and runtime errors appear.

My log is empty but the app fails.

Ensure you are looking in the correct application root, reproduce the error to generate fresh output, and add your own logging so events are recorded. Some failures also show in cPanel's web-server error logs.

How do I avoid huge log files?

Log at appropriate levels (not verbose debug in production) and rotate or clear old logs so they do not fill your disk. Structured logging libraries help you control verbosity.

Was this article helpful?