Docker and Kubernetes

See a container's logs

Read what a container printed, follow it live or see only the latest lines.

Fill these in once
  1. Show the logs
    Terminal
    docker logs my-app
  2. Follow new lines live
    Terminal
    docker logs -f --tail 100 my-app

    Press Ctrl + C to stop following.

  1. Show the logs
    Terminal · Ubuntu / Debian
    docker logs my-app
  2. Follow new lines live
    Terminal · Ubuntu / Debian
    docker logs -f --tail 100 my-app

    Press Ctrl + C to stop following.

  3. Clear a container's logsNeeds sudo
    Terminal · Ubuntu / Debian
    sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' my-app)
  1. Show the logs
    PowerShell
    docker logs my-app
  2. Follow new lines live
    PowerShell
    docker logs -f --tail 100 my-app

    Press Ctrl + C to stop following.