Tomcat access log: wrap thread name in quotes

XMLWordPrintable

      Suggestion

      This trivial suggestion will improve the parsability of Tomcat's access log.

      The Tomcat access log parsing format in server.xml is currently defined as

      %a %{jira.request.id}r %{jira.request.username}r %t "%m %U%{sanitized.query}r %H" %s %b %D "%{sanitized.referer}r" "%{User-Agent}i" "%{jira.request.assession.id}r"
      

      %t, representing the thread name, is not wrapped in quotes.

      This is a problem because when Thread Diagnostics or Thready Plugin is enabled, spaces are included in the thread name. Spaces are a delimiter for this log format, so parsing this log can return consistent results depending on if the thread name contained a space. This include's Atlassian Support's own Stantler tool.

      Suggested solution

      Modify the server.xml as follows

      %a %{jira.request.id}r %{jira.request.username}r "%t" "%m %U%{sanitized.query}r %H" %s %b %D "%{sanitized.referer}r" "%{User-Agent}i" "%{jira.request.assession.id}r"
      

              Assignee:
              Unassigned
              Reporter:
              Alex [Atlassian,PSE]
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: