docker-logs
fetch container logs from STDOUT and STDERR
TLDR
Show container logs
$ docker logs [container]
Follow log output$ docker logs -f [container]
Show last N lines$ docker logs --tail [100] [container]
Show timestamps$ docker logs -t [container]
Show logs since time$ docker logs --since [2h] [container]
Show logs until time$ docker logs --until [1h] [container]
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.
