[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-24 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


The answer to that was: no, just don't specify any serializer/deserializer.

> 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, 2.0, 2.0.1
>Reporter: Mikael Ståldal
>Assignee: Remko Popma
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-24 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


Did you mean we should use these?
{code}
com.fasterxml.jackson.databind.deser.std.MapDeserializer;
com.fasterxml.jackson.databind.ser.std.MapSerializer;
{code}

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-24 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


Can you clarify what you mean by the "default Jackson behavior"? We don't need 
to create a custom serializer? What should we do instead?

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-24 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

Also maybe the default Jackson behavior does what you want. I'm not sure that 
the new JSON format can be represented with JSONSchema.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-23 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


*Quick summary of the problem*

XmlLayout, JsonLayout and YamlLayout have a shared code base but for the thread 
context we want to output XML in a different format from JSON/YAML.

Current JSON format:
{code}
  "contextMap" : [ {
"key" : "foo",
"value" : "FOO"
  }, {
"key" : "bar",
"value" : "BAR"
  } ]
{code}

This is OK for XML (and has the advantage the document structure can be 
captures in a schema) but is not desirable for JSON & YAML where the natural 
mapping is something like:
{code}
"contextMap": {
 "foo": "FOO",
 "bar": "BAR"
}
{code}


*Quick analysis of how this could be implemented*
 (I'm new to Jackson, so below is just guess work)

* context map output is created by {{ListOfMapEntrySerializer}}. This class is 
currently used for all Jackson-generated layouts (XML, JSON, YAML). To keep XML 
the same but change JSON and YAML we need to create a different serializer 
class for JSON, YAML.
* ListOfMapEntrySerializer creates an array of MapEntry objects to output 
{{\[\{"key" : "x", "value" : "y"\}\]}}. Instead, the new serializer 
should probably simply call something like the below because the key is not 
fixed:

{code}
JsonGenerator jgen;
jgen.writeStartObject();
for (Entry entry : map.entrySet()) {
jgen.writeStringField(entry.getKey(), entry.getValue());
}
jgen.writeEndObject();
{code}

* {{LogEventMixIn#getContextMap}} has the annotation that determines which 
serializer to use. Looks like we need to separate this into XmlLogEventMixIn 
and JsonYamlLogEventMixIn so we can annotate the {{getContextMap}} method with 
the new serializer.
* The mix-in is installed by {{Initializers.SetupContextInitializer}}, which is 
invoked by all Log4jXmlModule, Log4jYamlModule and Log4jJsonModule: we may need 
to split this for the separate layouts

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-22 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

I think that we should consider at least the YAML layout as a showstopper since 
it is new. It would be quite silly to release a new layout with incorrect 
behaviour and then change it in a later release.


> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-21 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


Just to double-check: this is not a showstopper for the 2.6 release, is it?

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-21 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

Don't forget that there is YAML as well.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-21 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-623:


Since the same code is used for XML and JSON, whoever fixed this should take 
care that the XML format for the context map stays as is, with key="key" and 
value="value", while JSON and YAML have "key": "value". (Don't break the XML 
layout when fixing the JSON layout.)

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-05-06 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

This is still not fixed.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-04-12 Thread Matt Sicker (JIRA)

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

Matt Sicker commented on LOG4J2-623:


Agreed on fixing.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2016-04-12 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Nice if we can finally fix this.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2015-10-01 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Should we close this as Won't Fix since changing the format now will break 
backwards compatibility?

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2015-05-08 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Still not fixed in 2.2.

> 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, 2.0, 2.0.1
>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.3.4#6332)

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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


Mikael, I would say that the Javadoc for the component needs to call it out 
plus we should have a page that lists the dependencies and when they are 
required.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

But how is the poor Log4j user supposed to know that he/she needs to include 
Jackson dependencies in his/her project in order to get JSONLayout to work? 
That user may not even know what Jackson is.


> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


Gary, I would not be in favor of making Jackson a required dependency.  IMO, 
users need to be able to have a functional Log4j that is able to run with only 
the api and core jars.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Joern Huxhorn (JIRA)

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

Joern Huxhorn commented on LOG4J2-623:
--

@Ralph Ah, I see. I wasn't aware that JSON configuration exists.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


While I agree in principal, what is awkward about that is that while the 
JSONConfiguration and JSONLayout both require Jackson, the XMLConfiguration 
does not while XMLLayout now also requires Jackson, so the separate module 
would contain JSONConfiguration, JSONLayout and XMLLayout, which seems a bit 
odd to include in a log4j-json jar.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

Another path would be to redo XML and JSON configuration to be based on the 
same common Jackson code. All of the XML/JSON layout/listeners are all based on 
the same Jackson code.

The side effect is that Jackson would be required, unless you'd 
programmatically configure Log4j, which I am not sure is possible.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-16 Thread Matt Sicker (JIRA)

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

Matt Sicker commented on LOG4J2-623:


You're just supposed to add jackson-databind to your project's dependencies to 
get support for JSON in log4j. No need to edit the log4j pom.xml files.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-15 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


You don't have to represent multiple inheritence.  Instead it could just be

{code}
"marker": "marker1"
{code}

with no parents and

{code}
"marker": {"marker1" : ["parent1", "parent2"] }
{code}

with parents.  If you really want parents then you would do:

{code}
"marker": {"marker1" : ["parent1", {"parent2" : ["grandparent1", 
"grandparent2"]}, {"parent3" : "grandparent3"}}
{code}

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-15 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


You don't want to be modifying Log4j's pom.xml.  These jars are optional 
because they are only required if you want support for JSON, and I suppose now 
also for XML serialization/deserialization.  Instead, add the jars to your 
project's pom.xml as dependencies.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-15 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

I tried to remove the true from jackson-core in 
log4j-core, just to find out the the same issue applies to jackson-databind.

After removing true from jackson-databind as well, 
JSONLayout works.



> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-15 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

@Jeorn: The above XML and JSON was produced using (almost) the same Jackson 
code. This is not committed yet. 

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread Joern Huxhorn (JIRA)

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

Joern Huxhorn commented on LOG4J2-623:
--

I suppose moving the XML- and JSON-layouts into respective modules, each with 
proper non-optional dependencies, isn't an option? Not sure if they should 
really be considered core functionality of log4j.

{{}} is often a "dependency smell" indicating insufficient 
modularization. A counter-example would be an optional woodstox dependency that 
would replace the Java StAX implementation with the (faster) woodstox one if 
present. But the code would still work even without that woodstox dependency, 
making the dependency truly optional. The code would simply have worse 
performance.

Explaining that an "log4j2-json-layout" dependency needs to be added if the 
JSON layout is desired is easier to grasp than "Oh, that error? That means you 
need to add these two jackson dependencies.", probably on StackOverflow. People 
(at least some) tend to not read documentation. And those are enough to create 
unnecessary noise/support overhead on the user mailinglist.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Now I get this problem instead, probably not related to JSONLayout:

java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.logging.log4j.web.Log4jWebInitializerImpl
at java.lang.Class.forName0(Native Method) ~[?:1.7.0_51]
at java.lang.Class.forName(Class.java:270) ~[?:1.7.0_51]
at 
org.apache.logging.log4j.core.util.Loader.initializeClass(Loader.java:272) 
~[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:483)
 ~[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:595)
 [log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.(ThrowableProxy.java:145)
 [log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.(Log4jLogEvent.java:121) 
[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.(Log4jLogEvent.java:97) 
[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.impl.DefaultLogEventFactory.createEvent(DefaultLogEventFactory.java:49)
 [log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367) 
[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:103) 
[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
at org.apache.logging.slf4j.Log4jLogger.log(Log4jLogger.java:374) 
[log4j-slf4j-impl-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]

I have declared dependency to log4j-web. I think that the class 
org.apache.logging.log4j.web.Log4jWebInitializerImplis found, but fails to 
initialize for some reason.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

I use an XML configuration file, and JSONLayout.

I don't use Jackson in my app, so my app's POM doesn't say anything about it. 
And why should it? The use of Jackson is an implementation detail of Log4j that 
the user shouldn't need to care about, isn't it?

(BTW, I use Gradle and not Maven for building my app.)


> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Then you need to clearly document when those Jackson dependencies are needed, 
since you cannot expect a regular Log4j user to know that.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

Hm, let's see {{JsonProcessingException}} is in {{jackson-core-2.3.3.jar}} and 
I see the following in {{log4j-core}}'s {{pom.xml}}:

{code:xml}

  com.fasterxml.jackson.core
  jackson-core
  true

{code}

So you need to make jackson-core required in your app's POM.

Now we need to check if our use of jackson-core is really optional...

BTW, do you use an XML or JSON configuration file?

Thank you,
Gary

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

The latest code from SVN does not seem to work, I get this error when trying to 
use JSONLayout:

java.lang.NoClassDefFoundError: 
com/fasterxml/jackson/core/JsonProcessingException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.privateGetPublicMethods(Class.java:2651)
at java.lang.Class.getMethods(Class.java:1467)
at 
org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.withFactoryMethodAnnotatedBy(PluginBuilder.java:87)
  
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:710)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:665)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:657)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:657)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:334)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:156)
at 
org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:380)
at 
org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:427)
at 
org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:164)
at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:73)
at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:35)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:268)
at org.apache.log4j.Logger$PrivateManager.getContext(Logger.java:59)
at org.apache.log4j.Logger.getLogger(Logger.java:41)


> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-14 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

I did not know that markers support multiple inheritance, since the current 
documentation says that they don't: 

http://logging.apache.org/log4j/2.x/manual/markers.html
http://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

But I see now that this has changed in the latest code in SVN. So forget about 
my comment about markers.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Joern Huxhorn (JIRA)

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

Joern Huxhorn commented on LOG4J2-623:
--

@Gary Ah, ok. The earlier [comment from 
Mikael|https://issues.apache.org/jira/browse/LOG4J2-623?focusedCommentId=13995061&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13995061]
 with the malformed JSON made me a bit nervous. I thought you'd just build that 
JSON manually which is usually a bad idea. I love Jackson. :)

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


The above should say "if you really want grandparents".

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

@Joern Huxhorn : Yeah, previous Log4j 1 and 2 implementation of the JSON (v 2 
only) and XML layouts were basically giant toStrings, nasty ;) At least we 
agree on that! :)

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Joern Huxhorn (JIRA)

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

Joern Huxhorn commented on LOG4J2-623:
--

If you are interested: [this|http://pastebin.com/zFCdVGNd] is an example of the 
Lilith JSON.

Take a look at the encoder/decoder over at 
[GitHub|https://github.com/huxi/lilith/tree/master/lilith-data/logging-json-serializer/src/main/java/de/huxhorn/lilith/data/logging/json].
 It's using Jackson (which is available under Apache license).

I have yet to see any use of JSON Schema in the wild. The usual parsers 
(Jackson, Boon, GSON) certainly don't support it and if it doesn't support 
key-value maps like the above then it's useless anyway.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


Gary,

You seem to want to name all your elements.  In the representation I show above 
the Markers are objects. The Marker can contain no parents, 1 parent or 
multiple parents. Each parent can in turn have parents. You do this just 
through a JSON object representation.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

About JSON schema for the contextMap, can't you just declare it as "type": 
"object"?


> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Gary Gregory (JIRA)

[ 
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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

@Mikael Ståldal : Your example does not cut it, you need to be able to 
represent multiple inheritance, for example:

{code:java}
final Marker cMarker = MarkerManager.getMarker("Marker1");
final Marker pMarker1 = MarkerManager.getMarker("ParentMarker1");
final Marker pMarker2 = MarkerManager.getMarker("ParentMarker2");
final Marker gfMarker = MarkerManager.getMarker("GrandFatherMarker");
final Marker gmMarker = MarkerManager.getMarker("GrandMotherMarker");
cMarker.addParents(pMarker1);
cMarker.addParents(gfMarker);
pMarker1.addParents(gmMarker);
pMarker1.addParents(gfMarker);
{code}

Which I represent as:

{code:javascript}
  "marker": {
"name": "Marker1",
"parents": [{
  "name": "ParentMarker1",
  "parents": [{
"name": "GrandMotherMarker"
  }, {
"name": "GrandFatherMarker"
  }]
}, {
  "name": "GrandFatherMarker"
}]
  },
{code}

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

marker now looks like this:

{code}
 "marker": {
"name": "Marker1",
"parents": [{
  "name": "ParentMarker1"
}, {
  "name": "ParentMarker2"
}]
  },
{code}

perhaps it can be simplified to this:
{code}
 "marker": ["Marker1", "ParentMarker1", "ParentMarker2"],
{code}

It will then be similar in structure to contextStack.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread Joern Huxhorn (JIRA)

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

Joern Huxhorn commented on LOG4J2-623:
--

I'd suggest to use something like 

{code:xml}

A_Value
B_Value

{code}

for XML.

The difference is subtle. While line-breaks are [allowed in 
XML|http://www.w3.org/TR/REC-xml/#NT-AttValue], an XML parser is 
[normalizing|http://www.w3.org/TR/REC-xml/#AVNormalize] attribute values, 
changing line-breaks to space. So writing and reading the Thread Context 
wouldn't be a lossless process currently.

Regarding JSON, it should definitely look like this:

{code:javascript}
"threadContext": {
 "MDC.A": "A.Value",
 "MDC.B": "B.Value"
}
{code}

JSON isn't XML.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-13 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Why are you going to undo the improvement to the context map?

(I don't care if the context map is named "contextMap", "mdc" or "Properties".)

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

As a reminder, the goal is to be able to ship a single XML Schema and a single 
JSON Schema to describe an Event.

Here we are only talking about the context map portion of the schema.

For XML, the representation of a context map should be along the line of:

Example 1:
{code:xml}




{code}

Example 2:
{code:xml}




{code}

Both of the above XML documents and all other documents for any key and value 
can be validated with the _same_ XML Schema, for example: 

{code:xml}

http://www.w3.org/2001/XMLSchema";>














{code}

While the following two documents cannot be validate with the same XML schema. 
Using XML Schema's "any" is not a solution because that would allow anything at 
all.

{code:xml}

B_Value
A_Value

{code}

and:

{code:xml}

C_Value
D_Value

{code}

For JSON, there is no W3C standard for JSON itself or any JSON Schema, but I do 
see references to http://json-schema.org/

Are you saying that you can write a JSON Schema that can validate both of the 
following documents while allowing for any key and value?

{code:javascript}
"mapName: {
 "MDC.B": "B.Value",
 "MDC.A": "A.Value"
}
{code}

and

{code:javascript}
"mapName: {
 "MDC.C": "C.Value",
 "MDC.D": "D.Value"
}
{code}

I'd like to see if so we can ship it!

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

Simple: If it is not this way, it is *not* possible to define and use an XML 
Schema (or JSON Schema) to validate XML (or JSON) events. 

If you use the key values as the tag names, then each different kind of context 
map will requires a special schema for those kinds of event. I am not 
considering defining "anything can go in a context map" a useful schema 
fragment definition.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


That is hardly surprising since the JSON spec doesn't define a "Map".  However, 
you can find plenty of examples where people are validating Maps using the 
proper syntax.  Remember, in JSON a "Map" is nothing more than an array with a 
String key and a value (where the value can be one or more objects).  I am not 
in favor of forcing a non-standard JSON syntax for this.

This has nothing to do with XML.  The "standard" way to define a Map in XML is 
as you have specified it.

It sounds to me like you are trying to force a square peg in a round hole.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


Unless you can provide a reason that the contextMap HAS to be like that you can 
expect my objection.

> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

You should expect the following before 2.0 (ASAP):

{code:javascript}
{
  "timeMillis": 1,
  "thread": "MyThreadName",
  "level": "DEBUG",
  "loggerName": "a.B",
  "marker": {
"name": "Marker1",
"parents": [{
  "name": "ParentMarker1"
}, {
  "name": "ParentMarker2"
}]
  },
  "message": "Msg",
  "thrown": {
"cause": {
  "name": "java.lang.NullPointerException",
  "message": "testNPEx",
  "localizedMessage": "testNPEx",
  "extendedStackTrace": [{
"class": "org.apache.logging.log4j.core.layout.JSONLayoutTest",
"method": "testAllFeatures",
"file": "JSONLayoutTest.java",
"line": 122,
"exact": false,
"location": "test-classes/",
"version": "?"
  }, {
"class": "org.apache.logging.log4j.core.layout.JSONLayoutTest",
"method": "testLocationOnCompactOnMdcOn",
"file": "JSONLayoutTest.java",
"line": 298,
"exact": false
  }, {
"class": "sun.reflect.NativeMethodAccessorImpl",
"method": "invoke0",
"line": -2,
"exact": false
  }, {
"class": "sun.reflect.NativeMethodAccessorImpl",
"method": "invoke",
"line": -1,
"exact": false
  }, {
"class": "sun.reflect.DelegatingMethodAccessorImpl",
"method": "invoke",
"line": -1,
"exact": false
  }, {
"class": "java.lang.reflect.Method",
"method": "invoke",
"line": -1,
"exact": false
  }, {
"class": "org.junit.runners.model.FrameworkMethod$1",
"method": "runReflectiveCall",
"file": "FrameworkMethod.java",
"line": 47,
"exact": false
  }, {
"class": "org.junit.internal.runners.model.ReflectiveCallable",
"method": "run",
"file": "ReflectiveCallable.java",
"line": 12,
"exact": false
  }, {
"class": "org.junit.runners.model.FrameworkMethod",
"method": "invokeExplosively",
"file": "FrameworkMethod.java",
"line": 44,
"exact": false
  }, {
"class": "org.junit.internal.runners.statements.InvokeMethod",
"method": "evaluate",
"file": "InvokeMethod.java",
"line": 17,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner",
"method": "runLeaf",
"file": "ParentRunner.java",
"line": 271,
"exact": false
  }, {
"class": "org.junit.runners.BlockJUnit4ClassRunner",
"method": "runChild",
"file": "BlockJUnit4ClassRunner.java",
"line": 70,
"exact": false
  }, {
"class": "org.junit.runners.BlockJUnit4ClassRunner",
"method": "runChild",
"file": "BlockJUnit4ClassRunner.java",
"line": 50,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner$3",
"method": "run",
"file": "ParentRunner.java",
"line": 238,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner$1",
"method": "schedule",
"file": "ParentRunner.java",
"line": 63,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner",
"method": "runChildren",
"file": "ParentRunner.java",
"line": 236,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner",
"method": "access$000",
"file": "ParentRunner.java",
"line": 53,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner$2",
"method": "evaluate",
"file": "ParentRunner.java",
"line": 229,
"exact": false
  }, {
"class": "org.junit.internal.runners.statements.RunBefores",
"method": "evaluate",
"file": "RunBefores.java",
"line": 26,
"exact": false
  }, {
"class": "org.junit.internal.runners.statements.RunAfters",
"method": "evaluate",
"file": "RunAfters.java",
"line": 27,
"exact": false
  }, {
"class": "org.junit.runners.ParentRunner",
"method": "run",
"file": "ParentRunner.java",
"line": 309,
"exact": false
  }, {
"class": "org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference",
"method": "run",
"file": "JUnit4TestReference.java",
"line": 50,
"exact": false
  }, {
"class": "org.eclipse.jdt.internal.junit.runner.TestExecution",
"method": "run",
"file": "TestExecution.java",
"line": 38,
"exact": false
  }, {
"class": "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner",
"method": 

[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Can you give a concrete example of what the JSON will look like?

It is not sufficient to say that it will be "equivalent" to the XML format, 
since JSON and XML are structurally different.


> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


Gary, the correct syntax for a map in JSON is 

{code}
"mapName: {
 "MDC.B": "B.Value",
 "MDC.A": "A.Value"
}
{code}

not the way it was previously generated.  The Jackson docs specifically mention 
that you can serialize and deserialize a Map with this syntax so I don't know 
why you would be having a problem.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

I am putting the finishing touches on redoing the XML and JSON layouts and 
receivers based on Jackson. Maps in XML and JSON will not be 
"somekey":"somevalue" because you cannot write a schema that will works for all 
JSON and XML documents with this kind of document.

The XML will be like:
{code:xml}




{code}
and the JSON will be equivalent.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-05-12 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

The syntax of the generated JSON is invalid, it looks like this:

{code:xml}
  { 
"logger":"MyLogger",
"timestamp":"1399900017525",
"level":"INFO",
"thread":"qtp18151360-47",
"message":"Doing stuff...",
"Properties": {
  "RequesterIp": "127.0.0.1"},
  "UserName": "admin"},
  "OrgName": "test"}
}
  }
{code}

There are superfluous '}' after each property.
 

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-04-30 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Ah, yes then I agree.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-04-30 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


I didn't mean in terms of structure. I mean the names in JSON and XML should 
match where it makes sense.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-04-30 Thread JIRA

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

Mikael Ståldal commented on LOG4J2-623:
---

Currently, it does mimic the XMLLayout. This is not a good thing in this case 
since JSON and XML have different structures.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-04-29 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOG4J2-623:


I would expect that the JSONLayout would mimic the XMLLayout to some degree.

> 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
>
> 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



[jira] [Commented] (LOG4J2-623) Better structure of Thread Context Map in JSONLayout

2014-04-29 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-623:
-

I am reconsidering some details of the JSON layout as I work through the JSON 
and XML receivers. This is WIP and I have been busy with other more urgent 
matters. I hope to return to it soon.

Gary

> 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
>
> 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