← Debugging144 / 640
hardkubectl

Retrieve logs from a specific container within a multi-container pod

command

kubectl logs POD_NAME -c CONTAINER_NAME

also accepted

kubectl logs POD_NAME -ckubectl logs POD_NAME --container CONTAINER_NAME

Command breakdown

Part of the Kubernetes CLI (kubectl) — Debugging category.

kubectllogsPOD_NAME-cCONTAINER_NAME
FlagPurpose
-cBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →