英文:
Is there any way to enable detailed tracing of http2 requests and responses in Go?
问题
有没有办法在GO中启用http2请求和响应的详细跟踪?
我希望能够记录连接尝试、超时和请求传输,以便在事后诊断生产问题。
在开发过程中使用Stracing是可以的,但它对于确定问题的详细信息并不有用。
谢谢。
英文:
Is there any way to enable detailed tracing of http2 requests and responses in GO?
I would like to be able to log connection attempts, timeouts, and transmission of requests so that I can diagnose production problems after the fact.
Stracing is fine during development, but it not useful for determining the details of problems after they occur.
Thank you
答案1
得分: 5
你可以设置GODEBUG=http2debug=1
或GODEBUG=http2debug=2
环境变量。
示例:
env GODEBUG=http2debug=2 go run something.go
来源:http://tip.golang.org/pkg/net/http/
英文:
You can set the GODEBUG=http2debug=1
or GODEBUG=http2debug=2
environment variable.
Example:
env GODEBUG=http2debug=2 go run something.go
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论