Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-8332

Add unique HTTP request id to logs

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2
    • Component/s: None
    • Labels:

      Description

      To make identifying logs of any kind which are related to a given HTTP request, a unique identifier should be generated and added to the logs.

      In sonar.log, it should be added in the "field" after "web", so this:

      2016.11.02 18:23:01 TRACE web[][sql] time=0ms | sql=select id, data     from notifications     order by id asc     limit ? | params=1
      

      will become this:

      2016.11.02 18:23:01 TRACE web[XXXXXXXXXX][sql] time=0ms | sql=select id, data     from notifications     order by id asc     limit ? | params=1
      

      It will also be possible to display this identifier in "access.log" by adding %reqAttribute{ID} to the pattern.

      Obviously, the generation of the unique identifier should be super fast to not create an overhead on each and every HTTP request.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebastien.lesaint Sebastien Lesaint
                Reporter:
                sebastien.lesaint Sebastien Lesaint
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: