ppkarwasz opened a new issue, #3623:
URL: https://github.com/apache/logging-log4j2/issues/3623

   ## Description
   
   Currently there is a difference in the way exceptions are formatted by the 
[`%ex` pattern 
converter](https://logging.apache.org/log4j/2.x/manual/pattern-layout.html#converter-exception)
 and the following [JSON Template Layout 
snippet](https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#event-template-resolver-exception):
   
   ```json
   {
     "$resolver": "exception",
     "field": "stackTrace",
     "stackTrace": {
       "stringified": true
     }
   }
   ```
   
   - JTL simply uses `Throwable.printStackTrace()` and the first line of the 
output is obtained by calling `Object.toString()`.
   - Pattern Layout uses `getClass().getName() + ": " + getLocalisedMessage()`.
   
   Those lines agree, unless an exception overrides `Object#toString()`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to