# Docker Logs: Find Out Why a Container Failed
URL: https://ctrlops.io/docs/modules/docker/logs
Published: 2026-11-05
Updated: 2026-11-11

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.

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

![The Docker Logs tab with the Log Streams list of containers and its Search containers box on the left, the test container selected, and its log on the right with the lines, since, INF, WRN, ERR, and DBG controls and Search logs in the toolbar, and the line streaming, following new output under the log](https://cdn.ctrlops.io/docs/docker-logs.webp)

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:

| Where | Best for |
| --- | --- |
| The **Logs** tab of Docker | Jumping between containers |
| The **Logs** tab of an [open container](https://ctrlops.io/docs/modules/docker/containers#open-a-container) | Fixing one container. It adds **Explain with AI** and **Split logs** |
| The **Logs** tab of a [stack](https://ctrlops.io/docs/modules/docker/containers#manage-a-compose-stack) | Reading all services of a stack together |

[Watch: View Docker Logs Without the Terminal - Filter, Search & Explain with AI (CtrlOps)](https://www.youtube.com/watch?v=oKgqZx23VMM)

## Find what you need

| I want to | Instead of typing | Go to |
| --- | --- | --- |
| Find out why a container failed | `docker ps -a`, `docker logs` | [Find out why](#find-out-why-a-container-failed) |
| Watch new lines live | `docker logs -f` | [Watch live](#watch-logs-live) |
| See only errors | `docker logs ... \| grep ERROR` | [Filter and search](#filter-and-search) |
| See older lines | `docker logs --tail 5000`, `--since 1h` | [See older lines](#see-older-lines) |
| Save a log | `docker logs ... > app.log` | [Download or copy](#download-or-copy-a-log) |
| Compare two containers | Two terminal windows | [Split logs](#compare-two-containers) |
| Read a whole stack | `docker compose logs` | [Stack logs](#read-the-logs-of-a-stack) |

## Find out why a container failed

### Pick the container

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

### Read the footer

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 code | What it usually means |
| --- | --- |
| `0` | The program finished by itself. No error, but it may not be meant to stop |
| `1` | The program stopped with an error. The log shows why |
| `137` | The container was killed, often because it ran out of memory. Look for `OOM` in the [Containers](https://ctrlops.io/docs/modules/docker/containers#read-the-container-list) list |
| `143` | The 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.

![The log of the test-cache-1 container with the cursor on the ERR 1 chip, which is turned on, the count reading 1 of 14 lines, and only the one red error line left in the log](https://cdn.ctrlops.io/docs/docker-logs-err-filter.webp)

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**.

![The Logs tab of the open test-cache-1 container with the ERR 1 chip on and the cursor on the Explain with AI sparkle icon at the right of the error line, next to the Copy line icon](https://cdn.ctrlops.io/docs/docker-logs-click-explain-ai.webp)

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](https://ctrlops.io/docs/modules/ai-terminal).

![The Terminal tab of the test-cache-1 container with the AI Assistant panel open and its message box filled in with Explain this error from test-cache-1 followed by the error line, ready to send](https://cdn.ctrlops.io/docs/docker-logs-explain-ai.webp)

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**.

## Filter and search

- **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*.

> Search and the chips look only at the lines already loaded. If you do not find a line, load more first. CtrlOps reads the level from the text of each line, so a line with no clue has no level.

These settings reset when you pick another container.

## See older lines

| Control | What it does |
| --- | --- |
| **lines** | How many of the newest lines to load: 100, 200, 500, 1000, or 5000 |
| **since** | Only lines from a time range: **All**, **Last start**, **10 min**, **1 h**, **6 h**, **24 h**, or **7 days** |
| **Load … older lines** | At 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](#download-or-copy-a-log) the log |

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

> Docker keeps logs with the container, so deleting or recreating a container removes its old logs. Docker also limits their size: each new container keeps 3 files of 10 MB if CtrlOps installed Docker or you used [Apply log limits](https://ctrlops.io/docs/modules/docker/dashboard#fix-what-needs-attention). Download a log first if you might need it.

## 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 with the test-cache-1 and redis logs side by side, each with its own toolbar, the compare with chips test, grafana, postgressss, and redis at the top with redis picked, and the redis log showing Live updates are off with a Follow button](https://cdn.ctrlops.io/docs/docker-split-logs.webp)

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

## Read the logs of a stack

Open a [stack](https://ctrlops.io/docs/modules/docker/containers#manage-a-compose-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

| Control | What it does |
| --- | --- |
| **Timestamps** | Shows or hides the time on each line |
| **Wrap** | Wraps long lines, or keeps them on one line |
| **Color lines by level** | Colors the whole line, not only the level |
| **Open JSON** | Shows a JSON line in a readable layout |
| **Expand log view** | Gives 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](https://ctrlops.io/docs/modules/log-management) 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](https://ctrlops.io/docs/modules/docker/containers#download-or-upload-files) 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](https://ctrlops.io/docs/modules/docker/dashboard#fix-what-needs-attention) 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.
