You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2013/12/27 23:13:50 UTC

[jira] [Resolved] (LOG4J2-478) The message and ndc fields are not JavaScript escaped in JSONLayout

     [ https://issues.apache.org/jira/browse/LOG4J2-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory resolved LOG4J2-478.
---------------------------------

    Resolution: Fixed

{noformat}
commit -m "[LOG4J2-478] The message and ndc fields are not JavaScript escaped in JSONLayout." C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml
    Transmitting file data ...
    Committed revision 1553750.
{noformat}


> The message and ndc fields are not JavaScript escaped in JSONLayout
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-478
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-478
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>    Affects Versions: 2.0-beta9
>            Reporter: Michael Friedmann
>            Assignee: Gary Gregory
>             Fix For: 2.0-rc1
>
>
> The output of the JSONLayout includes the "message" field as is.  If there are any embedded newlines, quote, etc, this renders the JSON output as invalid.  To correct this, the "message" field should be properly JavaScript escaped.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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