Skip to content

Use `kix logs`

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:

Run in 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-2r6kw/nginx] 2026/09/10 00:21:36 [notice] 1#1: start worker process 51
[pod/production-85577f7474-2r6kw/nginx] 10.244.0.1 - - [10/Sep/2026:00:21:37 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-2r6kw/nginx] 10.244.0.1 - - [10/Sep/2026:00:21:47 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-9qpc4/nginx] 10.244.0.1 - - [10/Sep/2026:00:21:35 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-9qpc4/nginx] 10.244.0.1 - - [10/Sep/2026:00:21:45 +0000] "GET / HTTP/1.1" 200 22 "-" "kube-probe/1.35" "-"
[pod/production-85577f7474-9qpc4/nginx] 10.244.0.8 - - [10/Sep/2026:00:21:46 +0000] "GET / HTTP/1.1" 200 22 "-" "curl/8.14.1" "-"

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:

Run in 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:

Run in 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:

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

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

Run in 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>:

Run in 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.