How to change log level for istio-proxy within a Deployment?

Solution Verified - Updated -

Environment

  • OpenShift Container Platform
    • 4.9 and later
  • Red Hat OpenShift Service Mesh
    • 2.1 and later

Issue

  • How to change log level for istio-proxywithin a Deployment?
  • Need to enable verbose logging for istio-proxy for troubleshooting purposes.

Resolution

  • Changing istio-proxy log level in your Deployment by adding the annotation sidecar.istio.io/componentLogLevel:
# oc edit deployment $<DEPLOYMENT_NAME>
 [...]
spec:
  template:
    metadata:
      annotations:
        "sidecar.istio.io/agentLogLevel": debug # level can be: trace, debug, info, warning, error, critical, off

Note:- The annotation sidecar.istio.io/logLevel will get the log level only for the istio-proxy which wraps the envoy logs as well.

  • The pod will restart after changing the annotation.

Root Cause

For debugging reasons, sometimes the log level needs to be adjusted to a more verbose level.

Diagnostic Steps

  • After change the log level use the following command to check the istio-proxy log
# oc logs $<POD_NAME> -c istio-proxy

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments