LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-logs

fetch container logs from STDOUT and STDERR

TLDR

Show container logs
$ docker logs [container]
copy
Follow log output
$ docker logs -f [container]
copy
Show last N lines
$ docker logs --tail [100] [container]
copy
Show timestamps
$ docker logs -t [container]
copy
Show logs since time
$ docker logs --since [2h] [container]
copy
Show logs until time
$ docker logs --until [1h] [container]
copy

SYNOPSIS

docker logs [options] container

DESCRIPTION

docker logs fetches the logs of a container. Shows STDOUT and STDERR output from the container's main process. Logs are captured by Docker's logging driver and can be filtered by time range or number of lines. Essential for debugging containerized applications and monitoring runtime behavior.

PARAMETERS

-f, --follow

Follow log output.
--tail string
Number of lines from end (default "all").
-t, --timestamps
Show timestamps.
--since string
Show logs since timestamp or duration.
--until string
Show logs before timestamp or duration.
--details
Show extra details.

INSTALL

sudo apt install docker-cli
copy
sudo dnf install docker-cli
copy
sudo pacman -S docker
copy
sudo apk add docker-cli
copy
sudo zypper install docker
copy
brew install docker
copy
nix profile install nixpkgs#docker
copy

SEE ALSO

Copied to clipboard
Kai