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

Better structure of Thread Context Map in JSONLayout

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0-rc1, 2.0, 2.0.1
    • 2.0-rc2
    • Layouts
    • 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

              rpopma Remko Popma
              mikaelstaldal Mikael Ståldal
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: