Please enable Javascript to view the contents

 ·  ☕ 1 分钟

Enable debug log by command line

https://projectcontour.io/docs/v1.10.0/troubleshooting/envoy-debug-log/

The envoy command has a --log-level flag that can be useful for debugging. By default, it’s set to info. To change it to debug, edit the envoy DaemonSet in the projectcontour namespace and replace the --log-level info flag with --log-level debug. Setting the Envoy log level to debug can be particilarly useful for debugging TLS connection failures.

Enable debug log by API

列出 logger 名字:

1
k -n idm-mark exec fortio-server -c istio-proxy -- curl -d '' http://localhost:15000/logging 
k -n idm-mark exec -it fortio-server -c istio-proxy -- bash

curl -XPOST http://localhost:15000/logging\?filter\=debug
curl -XPOST http://localhost:15000/logging\?filter\=trace
curl -XPOST http://localhost:15000/logging\?connection\=debug
curl -XPOST http://localhost:15000/logging\?conn_handler\=debug

https://www.servicemesher.com/blog/istio-debug-with-envoy-log/

登录 helloworld pod,通过 admin api 将日志级别改为 debug:

1
2
kubectl exec -it $HELLO_V1_POD -chelloworld -- sh
curl -XPOST http://localhost:15000/logging\?level\=info

以上操作会改动这个 envoy 的所有日志目标,还可以只修改指定目标的日志级别,以减少日志量,比如:

1
2
3
4
curl -XPOST http://localhost:15000/logging\?filter\=trace
curl -XPOST http://localhost:15000/logging\?conn_handler\=debug
curl -XPOST http://localhost:15000/logging\?connection\=debug
curl -XPOST http://localhost:15000/logging\?router\=debug
分享

Mark Zhu
作者
Mark Zhu
An old developer