Read your app's logs

logs, errors, nodejs, python, stderr, crash, npm, pip, debugging · 0 found this helpful

When a Node.js or Python app shows an error page or won't start, its logs usually say why. The panel shows them live, so you don't need to sign in to the server.

Before you start

You need a Node.js or Python app. Create one in Account → Hosting → your site → Apps. See Run a Node.js app or Run a Python app.

Watch the app's output

  1. Go to Account → Hosting → your site → Websites and open your app's site.
  2. Select the App logs tab.
The App logs tab showing app output with errors highlighted

App output shows what your app writes to its error stream, including crash reports and stack traces. It's the stderr.log file in your app's code folder.

  • New lines appear every 10 seconds while the tab is open. Updates pause when you switch to another browser tab and catch up when you come back.
  • Errors show in red and warnings in amber. Select Errors or Warnings to hide everything else, or All to see every line.
  • The panel shows the last 200 lines when you open the tab. Download gets the whole file.

You can watch one live log at a time. If you open App logs in a second browser tab or window, the first one pauses and says so. Select Resume here to switch back.

Turn on the server log

The server log records when the app starts, stops or fails to start, which helps when the app never gets far enough to print anything.

  1. On the App logs tab, select Server log.
  2. Select Turn on the server log.

The app restarts, and the log fills in from its next start. It's saved as app-server.log in the app's code folder.

Clear a log

Select Clear, then confirm. Clearing App output restarts the app so it writes to the fresh file. Download the log first if you want to keep it.

Each update reads only the newest part of the log, so even a long log stays quick to watch. A very large log (over 8 MB) may be too large to watch live. If you see that message, download the log, then clear it to keep watching.

See install and script output

The Packages and scripts tab installs what package.json or requirements.txt lists, and runs the scripts in package.json, such as build or migrate.

The Packages and scripts tab with its output
  1. Select Install, or Run beside a script.
  2. The task runs in the background and shows in the task tray. You can leave the page.
  3. When it finishes, Output shows what it printed, with errors in red.

For Python apps, type a package such as requests or Django>=5.0 and select Add and install. The panel adds it to requirements.txt and installs it.

Only one install or script runs at a time for each app. The output stays on the tab for a day.

Check that the app answers

The Runtime tab checks the app's address each time you open it, and after every restart or change. Check now runs the check again.

The Runtime tab with the version picker and health check
Shows Means
Answering in 40 ms The app is up
Starting It didn't answer in 5 seconds. Large apps can take longer the first time
Not answering Nothing answered. Open App logs for the reason
Error 500 The app answered with an error. Its output says what failed

What the logs hide

Logs pass through the panel before you see them. Passwords and keys that look like secrets, and the values of your environment variables, show as [hidden value]. Your app's own files still hold the full text, so a downloaded log shows it all.

If something goes wrong

Problem Fix
Cannot find module 'express' Packages aren't installed. Select Install on Packages and scripts
ModuleNotFoundError: No module named 'flask' Add it to requirements.txt, or use Add and install
EADDRINUSE or a fixed port Listen on process.env.PORT, not a fixed number like 3000
A value is undefined Set it in Environment variables, then save so the app restarts
The log stays empty The app may write somewhere else. Write errors to the error stream (console.error or sys.stderr), or turn on the server log
"Live view paused" You opened the log in another tab. Select Resume here
The app stops after a while It may be hitting a memory limit. See Resource limits

Was this helpful?

Still stuck? Ask us and we'll walk you through it.