Container Logs

Dealing with Container Logs

TL;DR

  • Print the Logs of a Container in a cluster

Summarizing Resources

Motivation

Debugging Workloads by printing out the Logs of containers in a cluster.

Print Logs for a Container in a Pod

Print the logs for a Pod running a single Container

  1. kubectl logs echo-c6bc8ccff-nnj52
  1. hello
  2. hello

Operations

One can also perfrom debugging operations such as:

  • Print Logs for all Pods for a Workload
  • Follow Logs for a Container
  • Printing Logs for a Container that has exited
  • Selecting a Container in a Pod
  • Printing Logs After a Time
  • Printing Logs Since a Time
  • Include Timestamps

and so on.

Command / Examples

Check out the reference for commands and examples.