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-kubeaddons-kommander-ui 2020-10-19T19:43:38.687Z [info]: Initializing (redux) store 2020-10-19T19:43:38.701Z [info]: Beginning cluster subscriptions for "kommander/konvoy-host-cluster"... 2020-10-19T19:43:38.703Z [info]: Staggering version subscription for "kommander/konvoy-host-cluster" by 1000 seconds 2020-10-19T19:43:38.707Z [info]: [watch] Initialized watch on /apis/rbac.authorization.k8s.io/v1/rolebindings 2020-10-19T19:43:38.707Z [info]: [watch] Initialized watch on /apis/rbac.authorization.k8s.io/v1/clusterrolebindings 2020-10-19T19:43:38.707Z [info]: [watch] Initialized watch on /apis/rbac.authorization.k8s.io/v1/roles 2020-10-19T19:43:38.707Z [info]: [watch] Initialized watch on /apis/rbac.authorization.k8s.io/v1/clusterroles 2020-10-19T19:43:38.720Z [info]: Staggering nodes subscription for "kommander/konvoy-host-cluster" by 1000 seconds 2020-10-19T19:43:38.724Z [info]: Staggering pods subscription for "kommander/konvoy-host-cluster" by 1000 seconds 2020-10-19T19:43:38.728Z [info]: Staggering namespaces subscription for "kommander/konvoy-host-cluster" by 1000 seconds
Debug Level Logging
$ kubectl logs -n kommander -l app=kommander-kubeaddons-kommander-ui 2020-10-19T19:48:52.756Z [debug]: API[MgmtCluster]: listKommanderClusterForAllNamespaces Response: 2020-10-19T19:48:52.756Z [debug]: API[MgmtCluster]: listKommanderClusterForAllNamespaces Body: 2020-10-19T19:48:52.756Z [debug]: dispatching KOMMANDER_CLUSTER_LIST_RECEIVED ...
Solution
Steps:
1. Access the Konvoy 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-kubeaddons-kommander-ui -n kommander LOG_LEVEL="debug"- Wait for the pod to restart - 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-kubeaddons-kommander-ui -n kommander LOG_LEVEL-3. To permanently set logging verbosity level to debug: - Modify the cluster.yaml file to include the following
- configRepository: https://github.com/mesosphere/kubeaddons-kommander configVersion: stable-1.17-1.1.2 addonsList: - name: kommander enabled: true values: | --- kommander-ui: env: LOG_LEVEL: debug- Run the following command to update the konvoy addons
$ ./konvoy deploy addons --yes- Wait for the pod to restart