Skip to content

DocsRun your app

Logs and crashes

Where to read what your app prints, where the build log is, and what happens when an app keeps crashing.

There are two logs: the runtime log of the app, and the build log of each deployment.

Open Logs. It shows the newest lines from every replica and refreshes every 3 seconds. You can pick one replica to read only its lines. The page calls a replica a machine.

What is in it:

  • What your app prints. Everything written with console.log and console.error.
  • What the platform notes. When a replica starts and stops, when it waits for your app to listen, when the app ran out of memory.

Print to the console. A log your app writes to a file is on the temporary disk of one replica, where you cannot read it.

Open a deployment under Deployments to read its Build log: the install, your build commands and your deploy commands, with their output. It is kept for 90 days after the deployment ended.

  • It is started again. A replica that exits with an error is restarted, up to 3 times.
  • It is noticed. If the app keeps crashing and no replica is serving, the overview says so and the team gets a notification: “App keeps crashing”.
  • The log says why. The last lines before the exit are in the runtime log, with the exit code.
Line in the runtime log What to do
The app exited with code N Read the lines above it: your app printed the error
The app ran out of memory and was stopped Choose a larger size under Scaling
The start command could not be run Check the start command in the build settings
The app kept crashing: after N restarts it is not started again Fix the error and deploy again

Troubleshooting has more messages.

Overview shows CPU and memory for each replica, and requests and response time across all replicas, for the last 24 hours.