[
https://issues.apache.org/jira/browse/LOG4J2-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Kemper closed LOG4J2-2755.
------------------------------------
Resolution: Invalid
Found the issue in an invalid configuration.
The incorrect Json String was created with a pattern and not with the routines
of log4j2.
> Invalid JSON in JsonLayout
> --------------------------
>
> Key: LOG4J2-2755
> URL: https://issues.apache.org/jira/browse/LOG4J2-2755
> Project: Log4j 2
> Issue Type: Bug
> Components: Layouts
> Affects Versions: 2.11.2
> Reporter: Christian Kemper
> Assignee: Ralph Goers
> Priority: Critical
>
> Using the log4j2 JsonLayout can result in invalid JSON. Some parsers could
> not parse this syntax.
> The problem ist the attribute "nanoOfSeconds" from the timestamp:
> {code:javascript}
> {
> "loggerFqcn": "org.apache.catalina.valves.AccessLogValve",
> "instant": {
> "epochSecond": 1578393313,
> "nanoOfSecond": 008000
> },
> "clientIp": "-",
> "remoteHost": "192.168.0.1",
> "message": "GET /metrics HTTP/1.1",
> "status": 200,
> "size": "50",
> "referer": "-",
> "processTimeMillis": 92
> }
> {code}
> The Attribute "nanoOfSeconds" starts with leading zeros. According to the
> JSONĀ [rfc4627|https://tools.ietf.org/html/rfc4627] this is an invalid JSON
> number.
> Is it possible to correct this and remove the leading zeros?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)