Skip to content
Browse docs

Docker Logs: Find Out Why a Container Failed

The Logs tab shows the output of any container on your server, live. Filter to the errors, search, read older lines, download a log, compare two containers side by side, and ask the AI to explain an error line.

Open in
Updated

The Logs tab shows what your containers print. It is the first place to look when something goes wrong.

Pick a container on the left, and read its output on the right.

You can read logs in three places. They all work the same way:

WhereBest for
The Logs tab of DockerJumping between containers
The Logs tab of an open containerFixing one container. It adds Explain with AI and Split logs
The Logs tab of a stackReading all services of a stack together

Find what you need

I want toInstead of typingGo to
Find out why a container faileddocker ps -a, docker logsFind out why
Watch new lines livedocker logs -fWatch live
See only errorsdocker logs ... | grep ERRORFilter and search
See older linesdocker logs --tail 5000, --since 1hSee older lines
Save a logdocker logs ... > app.logDownload or copy
Compare two containersTwo terminal windowsSplit logs
Read a whole stackdocker compose logsStack logs

Find out why a container failed

Pick the container

Click it in the Log Streams list. Search containers… helps on a busy server.

The line at the bottom tells you what happened, for example Container stopped · exit 1 · 4m ago. The exit code is a good first clue:

Exit codeWhat it usually means
0The program finished by itself. No error, but it may not be meant to stop
1The program stopped with an error. The log shows why
137The container was killed, often because it ran out of memory. Look for OOM in the Containers list
143The container was stopped normally

Look at the errors

Click the ERR chip to see only the error lines. Then clear it and read the lines just before the first error, because the real cause is often there.

Each chip shows how many lines have that level.

Ask the AI

Open the container, and go to its Logs tab. Rest on an ERR line, and two icons show at its right: Explain with AI (the sparkle) and Copy line. Click Explain with AI.

Rest on an ERR line to see the Explain with AI and Copy line icons.

CtrlOps switches to the Terminal tab and opens Ask AI. The question is filled in with that line, up to 20 lines before it, and the facts of the container, and you press send.

Secrets are masked first, and nothing is sent until you press send. It uses the same AI you set up for the AI Terminal.

The question waits in the message box. Nothing is sent until you press send.

Watch logs live

A log follows new lines by itself while the container runs, and the footer says streaming. Use this while you reproduce a bug.

  • Pause holds new lines so you can read. The footer counts what is waiting, and Resume catches up.
  • When a container restarts, a line such as Container started 10:42 marks the spot, and the log keeps going.
  • Jump to latest takes you back to the bottom after you scroll up.

Each server can have 6 live connections open at once, and live logs and terminals both count. Past that, a log shows the lines it has, with Live updates are off: 6 live connections are open. Close another log or terminal, then click Follow.

  • Level chips (INF, WRN, ERR, DBG) show only those lines, and you can turn on more than one. Lines with no level hide while a chip is on.
  • Search logs… keeps the lines with your text, and the count shows how many match, such as 12 of 200 lines.

These settings reset when you pick another container.

See older lines

ControlWhat it does
linesHow many of the newest lines to load: 100, 200, 500, 1000, or 5000
sinceOnly lines from a time range: All, Last start, 10 min, 1 h, 6 h, 24 h, or 7 days
Load … older linesAt the top of the log, loads more from the same log, such as Load 200 older lines, up to 20,000 lines. Past that, download the log

Last start is handy after a crash, because it hides everything from before the most recent start.

Download or copy a log

  • Download logs saves the log to your computer, not just the lines on screen. A very large log keeps its newest 50 MB.
  • Copy line copies one line. Rest on the line to see it.
  • Select lines lets you tick lines, then copy or download only those. Hold Shift and click to select a range.

Clear view only clears your screen. The logs on the server stay, and Reload logs shows them again.

Compare two containers

Open two containers from the Containers tab, then click Split logs in the strip at the top. Use compare with to pick the second one. This is useful when an app and its database fail at the same time.

Split logs needs at least two open containers. Pick the second one under compare with.

Read the logs of a stack

Open a stack and go to its Logs tab. All services show together, with a column that names the service. The lines count here is for each service, so 200 per service on a three-service stack can show 600 lines. Search logs… also matches the service name.

Other useful controls

ControlWhat it does
TimestampsShows or hides the time on each line
WrapWraps long lines, or keeps them on one line
Color lines by levelColors the whole line, not only the level
Open JSONShows a JSON line in a readable layout
Expand log viewGives the log the whole window

Tips

  • Start with Last start after a crash. It cuts out the noise from earlier runs.
  • Download before you recreate. A new container starts with an empty log.
  • For Nginx, PM2, or system logs, use the Logs tab of the server. It reads log files, and it also lists running containers if your login can run docker ps.

Troubleshooting

Most failures show Show details with the Likely cause, Retry where it helps, and Copy report. Send that report with any support question.

No output yet.

The container has not written anything to its standard output in this time range. Set since to All. Some apps write to a file inside the container instead. Check the Files tab of the container.

Logging is off for this container.

The container uses the none log driver, so Docker keeps no logs for it. To change that, recreate it with a different log driver.

Docker cannot read the logs of this container.

Its log driver sends logs somewhere else, and Docker cannot read them back. Check the system the driver sends them to.

Type the sudo password to see live logs.

Your login needs sudo to use Docker. Type the password. If you see CtrlOps cannot answer this sudo prompt., your server asks for more than a password, such as a one-time code. Use NOPASSWD sudo or the docker group for this login.

Live updates are off: 6 live connections are open.

Each terminal and each followed log uses its own SSH connection, and a server tab allows 6. Close a terminal session or stop following a log, then click Reload logs.

This container does not run, so there are no new lines to follow.

You can still read what it wrote before it stopped. Start the container to get new lines.

CtrlOps cannot open the log stream.

Check that the server accepts a new SSH connection, then click Retry.

I do not see Explain with AI

It shows on ERR lines in the Logs tab of an open container, as a sparkle icon at the right of the line. Click the container in the Containers tab, go to Logs, and rest on an error line. If no line is marked ERR, ask in the Ask AI panel of the Terminal tab instead.

The Compose plugin is not installed. CtrlOps cannot show the stack logs.

Stack logs need Docker Compose v2. Go to the Dashboard and click Install Compose plugin. You can still read each container on its own.

Frequently Asked Questions

Does Clear view delete my logs?

No. Clear view only removes the lines from your screen. The logs on the server stay, and Reload logs shows them again.

Can I see the logs of a deleted container?

No. Docker keeps logs with the container, so deleting or recreating a container removes its old logs. Download them first if you might need them.

Why can't I see older logs?

Docker keeps a limited amount. If CtrlOps installed Docker or you applied log limits, each new container keeps 3 files of 10 MB, and older lines are removed. Choose more lines, use Load older, or set the since menu to All to see everything Docker still has.

Does CtrlOps store my logs?

No. CtrlOps reads them from Docker over SSH and shows them on your computer. It keeps no history, and nothing goes to an AI until you press send.

How does CtrlOps know a line is an error?

It reads the line, looking for a level field, a word like error or warn, or an HTTP status. Without a level field, an error word such as fail wins over warning, so a warning that mentions a failure shows as ERR. Lines with no such clue have no level, so they hide when you turn on a level chip. Some errors can be missed, so clear the chips if you do not see what you expect.

Ask AI

Your privacy preferences. We use product analytics to improve CtrlOps. Google measurement runs without analytics cookies. Live chat stays off until you allow it. Cookie policy