FahamLah

Commands

docker logs

docker logs [-f] [--tail n] <container>

Risk: Safe

What it does

Shows what a container printed.

When to use it

First thing to check when a container misbehaves.

Example

$ docker logs web

Read web's messages.

$ docker logs -f web

Keep watching new lines. Ctrl+C stops.

$ docker logs --tail 5 web

Only the last 5 lines.