brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: docker logs --since 10m -f shows only what just happened

Docker
~/tips/tip-docker-logs-since

docker logs --since 10m -f container-name

Shows only the last few minutes of a container's log and follows new lines.

A container that has been up for months has a log of thousands of lines. Scrolling to the end is slow, and the part you care about is usually the last few minutes. Docker can cut the log down for you.

docker logs --since 10m -f container-name

--since takes a duration such as 10m or 2h, or a timestamp such as 2026-11-16T08:00:00. -f follows new lines as they arrive, like tail -f. Press Ctrl+C to stop following; the container keeps running.

  • --tail 50 shows only the last 50 lines. Combine it with -f for a quick look and then live updates.
  • -t puts a timestamp in front of each line, useful when the app does not log its own.
  • --until 30m is the opposite of since: everything up to thirty minutes ago.
  • 2>&1 | grep -i error filters the output. Docker writes the container’s stderr to your stderr, so redirect it first.

A container fails to start after an update. Look at the last minute only:

docker logs --since 1m --tail 100 sonarr

Often the error is right there: a permission problem on a volume, a missing variable or a port that is already taken. For a broader view over several containers, use the compose project: docker compose logs --since 10m -f.

The Docker tab has a log icon per container that shows the same output in a window, and the terminal on the server accepts the same options. The window is fine for a quick look, but the command gives you the time filter.

You only see what the app writes to stdout and stderr. An application that logs to a file inside the container looks silent, and you need docker exec to read that file. Also, logs disappear when the container is removed and recreated, which is what an update does. If you want to keep them, set up a log driver or a limit with --log-opt max-size=10m, otherwise a busy container can fill the disk with a log that never rotates.

Further reading: docker logs reference (Docker docs), On this site: docker inspect tells you if a container is healthy, not just running, On this site: docker compose logs –since 10m shows only what just happened, On this site: Stop Docker logs from filling your disk with log rotation

More Docker tips ONBUILD RUN /usr/local/bin/python-build --dir /app/src SHELL ["/bin/bash", "-c"] docker commit <container> myname/testimage:version3 docker import /path/to/exampleimage.tgz docker compose events All Docker tips (192) All topics

Link