dongyan2445 2016-04-09 06:11
浏览 279
已采纳

有什么方法可以在Go中启用对http2请求和响应的详细跟踪?

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条回答 默认 最新

  • duanca3415 2016-04-09 21:41
    关注

    You can set the GODEBUG=http2debug=1 or GODEBUG=http2debug=2 environment variable.

    Example:

     env GODEBUG=http2debug=2 go run something.go
    

    source: http://tip.golang.org/pkg/net/http/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?