Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8351347

HttpClient Improve logging of response headers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 25
    • core-libs

      Here is how response headers are logged for HTTP/1.1 and HTTP/2

      The first line is for an intermediate response (102), the second for a final response(200)

      ----------------- http/1.1 --------------------------------
      INFO: HEADERS: RESPONSE HEADERS:


      INFO: HEADERS: RESPONSE HEADERS:
          content-length: 11

      ----------------- http/2 --------------------------------
      INFO: HEADERS: RESPONSE HEADERS:
          :status: 102

      INFO: HEADERS: RESPONSE HEADERS:
          :status: 200
          content-length: 11

      --------------------------------------------------------------------------

      I'd suggest that we add the Response::toString for HTTP/1.1, that will contain the status + URI, and the streamId for HTTP/2, which will help corelate with the request headers (the streamId is already logged with the
      request headers)

      For instance, something like below would be an improvement:

      ----------------- http/1.1 --------------------------------
      INFO: HEADERS: RESPONSE HEADERS (GET http://127.0.0.1:59767/test/hello) 102 HTTP_1_1 Local port: 59772:


      INFO: HEADERS: RESPONSE HEADERS (GET http://127.0.0.1:59767/test/hello) 200 HTTP_1_1 Local port: 59772:
          content-length: 11

      ----------------- http/2 --------------------------------
      INFO: HEADERS: RESPONSE HEADERS (streamid=1):
          :status: 102

      INFO: HEADERS: RESPONSE HEADERS (streamid=1):
          :status: 200
          content-length: 11

            dfuchs Daniel Fuchs
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: