Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Invalid
-
2.11.2
-
None
-
None
Description
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:
{ "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 }
The Attribute "nanoOfSeconds" starts with leading zeros. According to the JSONĀ rfc4627 this is an invalid JSON number.
Is it possible to correct this and remove the leading zeros?