Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1448

Add context information to DefaultRequestDirector INFO level logging

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.3.3
    • HttpClient (classic)
    • None

    Description

      In Nexus MRM HttpClient4x is used as transport. Nexus is a proxy server, hence there is a lot of (independent) interaction of HttpClient4x with remote servers on behalf of incoming requests. HttpClient does some INFO level logging that in my opinion lacks some context. Typical example:

      2014-01-14 12:31:17 INFO [qtp1303027754-18064] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:31:17 INFO [qtp1303027754-18064] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:31:21 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:31:21 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:31:28 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:31:28 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:31:40 INFO [qtp1303027754-18053] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:31:40 INFO [qtp1303027754-18053] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:31:47 INFO [qtp1303027754-18060] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:31:47 INFO [qtp1303027754-18060] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:32:02 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:32:02 INFO [qtp1303027754-18036] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request
      2014-01-14 12:32:18 INFO [qtp1303027754-18059] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
      2014-01-14 12:32:18 INFO [qtp1303027754-18059] org.sonatype.nexus.apachehttpclient.Hc4ProviderBase$DefaultHttpClientImpl - Retrying request

      "Muting" the logger category or raising level to WARN is not an option, as we do not want to "mute" whole HttpClient4x.

      This is emitted by DefaultRequestDirector at INFO level, but is merely a log-spam, as it does not offer much information about actual host/target causing it.

      I'd propose to equip these messages with some technical and contextual information. Patch will be provided in few.

      Note: another option would be to just "lower" these logs (or one of the two) to DEBUG level, and leave the "Retrying request" part but with target host added.

      Attachments

        1. HTTPCLIENT-1448.patch
          2 kB
          Tamas Cservenak

        Activity

          People

            Unassigned Unassigned
            cstamas Tamas Cservenak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: