How to enable debug logging level for envoy
search cancel

How to enable debug logging level for envoy

book

Article ID: 297892

calendar_today

Updated On:

Products

VMware Tanzu Application Platform

Issue/Introduction

The default logging level for envoy is info. How can we enable the debug logging level?

Environment

Product Version: 1.3

Resolution

1. Edit the tap-values.yaml file to set the logLevel to debug.

contour:
  envoy:
...
    logLevel: debug

2. Update the tap package by running:

$ tanzu package installed update tap --package-name tap.#####.######.com \
  --version $TAP-VERSION --values-file tap-values.yaml -n tap-install

3. The envoy pods will be recreated and confirm the debug logging level settings after the new envoy pods are up running.

$ kubectl -n tanzu-system-ingress get pod envoy-xyz \
   -o jsonpath='{.spec.containers[1].args[*]}'
...
--log-level debug

$ kubectl -n tanzu-system-ingress logs envoy-xyz envoy
...
[2023-04-04 01:35:42.296][1][debug][dns] [source/extensions/network/dns_resolver/cares/dns_impl.cc:262] dns resolution for contour completed with status 0
[2023-04-04 01:35:42.296][1][debug][upstream] [source/common/upstream/upstream_impl.cc:274] transport socket match, socket default selected for host with address 10.100.230.30:8001
[2023-04-04 01:35:42.296][1][debug][upstream] [source/common/upstream/strict_dns_cluster.cc:178] DNS refresh rate reset for contour, refresh rate 5000 ms

4. When there is no need to keep the debug logging level enabled, edit the tap-values.yaml file again to remove logLevel: debug. Then update the tap package and the logging level will be set back to info.