[ 
https://issues.apache.org/jira/browse/LOG4J2-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996655#comment-13996655
 ] 

Gary Gregory commented on LOG4J2-623:
-------------------------------------

I like this latest marker representation. It's easy to read and terse. I'm sure 
there's a way to do that in Jackson. It is quite powerful now that I've spent 
some time with it.

Let do this: I'll commit what I have now which works with all tests passing. 
This gives us Jackson based XML and JSON _listeners and layouts_.

Then we can fiddle with each little element and attribute until we settle upon 
a final representation.

My goals here are:
- Add XML and JSON listeners to Log4j 2.
- Find the easiest way to make sure that layouts and listeners are in sync. 
Jackson is great way to do this.
- Stay away from writing low-level XML/DOM code and JSON parsing code. This 
would be a lot of code to maintain and forget keeping the layouts and listeners 
easily in sync.

> Better structure of Thread Context Map in JSONLayout
> ----------------------------------------------------
>
>                 Key: LOG4J2-623
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-623
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>    Affects Versions: 2.0-rc1
>            Reporter: Mikael Ståldal
>            Assignee: Ralph Goers
>            Priority: Minor
>             Fix For: 2.0-rc2
>
>
> Currently, the Thread Context Map looks like this in JSONLayout:
> {code:JavaScript|title=Current}
>  "Properties":[
>       {
>         "name":"UserName",
>         "value":"admin"
>       },
>       {
>         "name":"OrgName",
>         "value":"test"
>       } 
>     ] 
> {code}
> 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"?
> {code:JavaScript|title=Suggested}
>   "mdc": {
>     "UserName":"admin", 
>     "OrgName":"test"
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to