Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.14.1
-
None
Description
When using the JsonTemplateLayout and configuring the message with a fallbackKey...
"message": { "$resolver": "message", "fallbackKey": "asString" }
the fallbackKey is not consistently used.
When logging via org.apache.log4j.Category.info(Object) the message string is logged directly without using the property defined in fallbackKey, e.g.
{"timestamp":"2021-04-21T14:25:27.625+01:00","loggerName":"explore.log4j.json.template.layout.Main","level":"INFO","message":"Message logged using org.apache.log4j.Category.info(Object)"}
but when logging using org.apache.logging.log4j.Logger.info(String) the message is correctly logged in the asString property as required, i.e.
{"timestamp":"2021-04-21T14:25:27.628+01:00","loggerName":"explore.log4j.json.template.layout.Main","level":"INFO","message":{"asString":"Message logged using org.apache.logging.log4j.Logger.info(String)"}}
Sample Maven project attached to reproduce.
Attachments
Attachments
Issue Links
- links to