Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-623

Better structure of Thread Context Map in JSONLayout

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1, 2.0, 2.0.1
    • Fix Version/s: 2.0-rc2
    • Component/s: Layouts
    • Labels:
      None

      Description

      Currently, the Thread Context Map looks like this in JSONLayout:

      Current
       "Properties":[
            {
              "name":"UserName",
              "value":"admin"
            },
            {
              "name":"OrgName",
              "value":"test"
            } 
          ] 
      

      This does not properly make use of the JSON data format. Since the Thread Context Map is a map, it should be represented as a JSON object. And why not name it "mdc" rather than the quite vauge "Properties"?

      Suggested
        "mdc": {
          "UserName":"admin", 
          "OrgName":"test"
        }
      

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              rpopma Remko Popma
              Reporter:
              mikaelstaldal Mikael Ståldal

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment