Docker / Compose

Docker / Compose: docker logs --tail 100 -f <container> — Linux

Follow the latest container logs.

Availability: Tool and version dependent; install separately where required.中文

Syntax

docker logs --tail 100 -f <container>

Examples

Follow the latest container logs.

docker logs --tail 100 -f <container>

Parameters, options and clauses

Option / clauseDescription
--tail <n|all>Show the last n lines, or all available lines.
-f, --followContinue streaming new log output.
--since <timestamp>Show logs since a time or relative duration.
--until <timestamp>Show logs up to a time.
-t, --timestampsAdd timestamps to log lines.
<container>Specify a container name or ID.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory