Skip to content
masterclass Buddy

DevOps · Command

kubectl logs

Print logs for a container in a pod or supported resource. You can stream logs, choose a container, read previous logs, or limit the output.

Last updated

Syntax

kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • kubectl get
  • kubectl describe
  • kubectl events
  • kubectl exec
  • kubectl attach

Source: kubectl logs | Kubernetes. Checked 2026-11-03.