Skip to content
kix /docs
Install the CLI

How-to guide Operate a cluster

Use kix logs

Read or follow logs for the primary workload of a package instance.

Use kix logs when you know the Kix package instance but do not want to look up its Kubernetes workload or label selector first.

Provide the cluster name and package instance:

kix-examples/
❱ kix logs how-to-application production --tail 3
Building cluster 'how-to-application'...
  Evaluating cluster 'how-to-application'...
  Reading package index...
  Loading store graph...
  Reading 3 packages...
  Discovering cluster-level resources...
  Computing cross-package dependencies...
  → kubectl logs for Deployment production in how-to-app (selector: app.kubernetes.io/instance=production,app.kubernetes.io/name=production)
[pod/production-85577f7474-pmklv/nginx] 10.244.0.1 - - [28/Sep/2026:08:01:09 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-pmklv/nginx] 10.244.0.8 - - [28/Sep/2026:08:01:12 +0000] "GET / HTTP/1.1" 200 22 "-" "curl/8.14.1" "-"
[pod/production-85577f7474-pmklv/nginx] 10.244.0.1 - - [28/Sep/2026:08:01:19 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-7cmv4/nginx] 2026/09/28 08:01:06 [notice] 1#1: start worker process 68
[pod/production-85577f7474-7cmv4/nginx] 10.244.0.1 - - [28/Sep/2026:08:01:08 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-7cmv4/nginx] 10.244.0.1 - - [28/Sep/2026:08:01:18 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"

Kix resolves production to its primary workload, then reads every container in every Pod selected by that workload. Each line includes its Pod and container as a prefix, even when only one Pod matches.

Add --follow to keep streaming new lines:

kix-examples/
❱ kix logs how-to-application production --follow

Stop following with Ctrl-C.

Use --tail to choose the number of recent lines, or --since to select a relative time window:

kix-examples/
❱ kix logs how-to-application production --tail 50
❱ kix logs how-to-application production --since 15m

Durations can be combined, such as 1h30m.

All containers are read by default. Pass a container name to read only that one:

kix-examples/
❱ kix logs how-to-application production --container web

Use --previous to inspect the previous terminated container after a restart:

kix-examples/
❱ kix logs how-to-application production --previous

If the same instance name occurs in more than one package namespace, qualify it as <namespace>/<name>:

kix-examples/
❱ kix logs how-to-application how-to-app/production --tail 20

Pass --context to select a Kubernetes context and --flake to evaluate the cluster from another directory.

See the logs command reference for every option.