[ 
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.<init>(ThrowableProxy.java:145)
 [log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
        at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:121) 
[log4j-core-2.0-rc2-SNAPSHOT.jar:2.0-rc2-SNAPSHOT]
        at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(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

Reply via email to