Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-59405

Add thread name to Tomcat access.log logger

    XMLWordPrintable

Details

    • 3
    • 7
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Problem Definition

      Currently JIRA Tomcat Access Logging doesn't log Java thread name.

      127.0.0.1 747x53x5 admin [15/Jan/2016:12:27:39 +0100] "GET /rest/api/1.0/shortcuts/64027/7dc8e5bd8fc0e785f91b1532614125de/shortcuts.js HTTP/1.1" 200 522 10 "http://127.0.0.1:8080/secure/admin/ViewLogging.jspa" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:43.0) Gecko/20100101 Firefox/43.0" "1fq3aby"
      

      This makes troubleshooting of performance problems more complicated, as it hard to get thread from URL and other way around.

      Suggested Solution

      Add Java thread name "%I" to server.xml:

      pattern="%a %{jira.request.id}r %{jira.request.username}r %t "%m %U%q %H" %s %b %D "%{Referer}i" "%{User-Agent}i" "%{jira.request.assession.id}r" %I"
      

      Workaround

      Manually modify server.xml: :

      --- atlassian-jira-6.4.12-standalone/conf/server.xml.orig	2016-01-15 12:49:50.000000000 +0100
      +++ atlassian-jira-6.4.12-standalone/conf/server.xml	2016-01-15 12:56:37.000000000 +0100
      @@ -161,7 +161,7 @@
      
                   -->
                   <Valve className="org.apache.catalina.valves.AccessLogValve" resolveHosts="false"
      -                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t &quot;%m %U%q %H&quot; %s %b %D &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{jira.request.assession.id}r&quot;"/>
      +                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t &quot;%m %U%q %H&quot; %s %b %D &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{jira.request.assession.id}r&quot; %I"/>
      
               </Engine>
           </Service>*
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              11 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated: