Follow logs from several Compose services

Updated 28 November 2026

docker compose logs covers one project, from its folder, and filtering means piping to grep --line-buffered. dp follows any mix of containers, services and projects in one stream, from anywhere, and filters while lines arrive.

From the shell

$dp logs -f api worker

Each argument can be:

An exact container name or ID wins, then a service, then a project, then a prefix. Mix them freely: dp logs -f shop postgres follows a whole project and one extra container.

$ dp logs -f shop                      # every container in the shop project
$ dp logs -n 100 api                   # last 100 lines from each api container
$ dp logs --since 15m -t api worker     # last 15 minutes, with timestamps
$ dp logs -f --grep '(?i)error|timeout' shop

With several containers, every line starts with the container name in a stable color, and stderr lines are marked with ┃. --grep keeps only matching lines and highlights the match. Log levels are colored in plain text, JSON ("level" fields), logfmt (level=) and nginx formats.

dp ps -a sorted by status, and dp logs interleaving three containers with highlighted log levels
dp logs interleaving three containers.

In the TUI

Open dp, go to the Projects tab with 4, select a project row and press enter. You get every container in the project in one viewer, each with its last 500 lines to start. enter on a single container, in any tab, follows just that one.

Project log viewer following many containers, filtered by a regex with the matches highlighted
A project's logs filtered with (?i)error|warn.

Filter with a regular expression

Press / and type a pattern. Only matching lines stay on screen, matches are highlighted, and new lines are filtered as they arrive.

PatternShows
(?i)error|timeouterrors and timeouts, any case
status=5\d\dlogfmt lines with a 5xx status
"level":"(warn|error)"JSON warnings and errors

Patterns use Go's regular expression syntax, which has no lookahead, so filter for the lines you want rather than against the ones you don't. enter keeps the filter, esc while typing cancels the change, and ctrl+l clears it. An invalid pattern shows an error and keeps the last valid results. The filter searches the viewer's buffer, up to 5,000 lines; it doesn't fetch older logs.

Other keys in the log viewer

KeyAction
wWrap long lines (otherwise ← → pans)
tShow each line's timestamp in local time
?All log viewer keys
esc or qBack to the list

Containers that come and go

Project logs follow the project, not a fixed list of containers. When you scale a service, recreate it with docker compose up -d, or a container restarts, the new containers join the stream and keep the same color by name. If a source is interrupted, dp reconnects with a short backoff and resumes from the last timestamp, skipping lines it already showed. A project with no containers yet stays open and waits for them.

Full reference: Logs and Project logs.