Your app’s Logs page shows what it prints. Its Events tab shows what happened to it. The Console runs commands inside it.
Logs
Everything your app writes to standard output and standard error shows up in Logs. Write your logs there, not to files.
- Live: new lines appear about a second after your app prints them. If you scroll up, the page pauses; scroll down or press End to carry on.
- History: choose a Range to see older lines, newest first, and Load older lines for more.
- Filters: narrow by Process and Instance, or type in Filter text to search for a phrase, in any letter case.
- Our events, such as an instance starting or crashing, appear between your lines, marked with ●, so a crash shows next to what led up to it.
- Download saves the lines for the current filters and range as plain text.
Logs are kept for a limited time: Range goes back as far as they’re kept. To keep logs longer, send them to a log service of your own from your app.
Each instance can log a lot, but not without limit. Past its limit, lines are dropped, and a note in the log says how many. Your app never slows down because of logging.
Build output is on each deploy’s page as well. See Deploys and releases.
Events
Open Logs, then the Events tab, for everything that happened to your app, newest first:
- instances starting, running, crashing, running out of memory, failing or passing health checks, and stopping;
- deploys starting, succeeding, failing or being cancelled;
- scaling, with who did it;
- the web process going to sleep and waking, with how long the wake took;
- volume, backup and domain changes;
- stopping and starting the app;
- console sessions and commands.
Filter by Kind and Process. The app’s Overview shows the latest events too.
Emails when something fails
We email you when:
- a deploy fails;
- a process keeps crashing (crash-looping). You get one email for it, not one for every crash.
Both say what happened and link to the output. Turn either off under Settings → Notifications, along with the emails for a verified domain, a certificate close to expiring, and promo credit about to expire. Security, billing and account emails always go.
Running a command
The console’s Run a command runs a one-off command, such as a migration or clearing a cache, in a new instance of your current release.
- Open your app’s Console.
- Under Run a command, enter the Command, such as
php artisan migrate --force. - Under Size, from the process, choose the process whose size it gets.
- Choose Run.
Its output streams to the page, and the page shows its exit code at the end. Stop ends it early. It has your variables and secrets, and can reach your other apps’ private addresses.
Opening a shell
Open a shell gives you a terminal inside your app, in the browser.
- Under Where, choose:
- In a new instance: a fresh instance of the current release. Nothing you do there touches the running app, and it goes when the session ends.
- In a running instance: a shell beside your app, sharing its memory. The app keeps serving.
- Choose Open shell.
- When you’re done, choose End session, or exit the shell.
A shell in a running instance ends if a deploy replaces that instance. While it’s open, that instance doesn’t go to sleep.
Console limits and billing
- A session or a command lasts up to 60 minutes. A shell also ends after a while with no input or output, and the page says why it ended.
- Your organisation can run only a few sessions and commands at once. If you’re at the limit, end one, then try again.
- A new instance for a command or a shell is billed by the second at its size, like any instance.
- Console commands don’t count as data out.
Recent, on the Console page, lists who ran what and when. Commands are kept as typed; what’s typed in a shell never is.