How to increase the Kommander logging verbosity
Overview/Background
There may be times when you need to see more detail in the logs pertaining to Kommander in order to resolve an issue with Kommander and/or the Kommander UI. In this case we can increase the logging verbosity to "debug", which will give us more detail as to what is actually happening with Kommander.
Log Level Output:
Default Logging
$ kubectl logs -n kommander -l app=kommander-kommander-ui 2024-03-15T21:01:22.816Z [info]: Subscription started for kommander/host-cluster - Metrics
2024-03-15T21:01:23.483Z [info]: Subscription started for kommander/host-cluster - Version
2024-03-15T21:01:23.483Z [info]: Staggering nodes subscription for "kommander/host-cluster" by 1000ms
2024-03-15T21:01:24.485Z [info]: Subscription started for kommander/host-cluster - Nodes
2024-03-15T21:01:24.485Z [info]: Staggering pods subscription for "kommander/host-cluster" by 1000ms
2024-03-15T21:01:25.487Z [info]: Subscription started for kommander/host-cluster - Pods
2024-03-15T21:01:25.488Z [info]: Staggering namespaces subscription for "kommander/host-cluster" by 1000ms
2024-03-15T21:01:26.489Z [info]: Subscription started for kommander/host-cluster - Namespaces
2024-03-15T21:01:26.489Z [info]: Staggering dashboards subscription for "kommander/host-cluster" by 1000ms
2024-03-15T21:01:27.491Z [info]: Subscription started for kommander/host-cluster - Dashboards
...
Debug Level Logging
$ kubectl logs -n kommander -l app=kommander-kubeaddons-kommander-ui 2024-03-15T21:36:41.477Z [debug]: [authcaps] Invalidating cache
2024-03-15T21:36:41.477Z [debug]: dispatching CLUSTER_ROLE_WATCH_RECEIVED
2024-03-15T21:36:41.477Z [debug]: next state - clusters - [{"__typename":"Cluster",... ...
Solution
Steps:
1. Access the cluster
2. To temporarily set logging verbosity level to debug:
- Set the environment variable LOG_LEVEL="debug" for the kommander-kubeaddons-kommander-ui deployment in the kommander namespace
$ kubectl set env deployment/kommander-kommander-ui -n kommander LOG_LEVEL="debug"
- Wait for the pod to restart; after it restarts, the debug logs will be visible.
After collecting the debug information, we recommend setting the LOG_LEVEL back to default to reduce the volume of the logs created.
To do so, set the environment variable LOG_LEVEL back to default for the kommander-kubeaddons-kommander-ui deployment in the kommander namespace
$ kubectl set env deployment/kommander-kommander-ui -n kommander LOG_LEVEL="info"