Enable debug level logging in KOTS

To enable debug level logging in KOTS, edit the kotsadm deployment and set the KOTSADM_LOG_LEVEL environment variable to debug.

kubectl set env -n <namespace> deployment/kotsadm -c kotsadm KOTSADM_LOG_LEVEL=debug

The kotsadm pod will be recreated and should start emitting logs at debug level:

kubectl logs -n default kotsadm-66dfd94b85-9nf6x
sed: can't read /web/dist/index.html: No such file or directory
sed: can't read /web/dist/index.html: No such file or directory
2022/07/25 19:02:52 kotsadm version v1.77.0
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"waiting for object store to be ready[]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"waiting for database to be ready[]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"object store is ready[]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"database is ready[]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"migrating sessions from postgres[]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"migrating support bundles from postgres[]"}
{"level":"info","ts":"2022-07-25T19:02:52Z","msg":"Found kubectl binary versions [v1.24 v1.23 v1.22 v1.21 v1.20 v1.19 ]"}
{"level":"info","ts":"2022-07-25T19:02:52Z","msg":"Found kustomize binary versions [3 ]"}
{"level":"debug","ts":"2022-07-25T19:02:52Z","msg":"starting the operator[]"}
2022/07/25 19:02:52 Starting monitor loop

if KOTS is deployed with disableS3 enabled, then KOTS becomes a StatefulSet instead of a deployment.

Do this instead:

kubectl set env -n <namespace> statefulset/kotsadm -c kotsadm KOTSADM_LOG_LEVEL=debug
1 Like