apache / apache/logging-log4j2
Uniformise `%ex` pattern and `exception` JTL resolver
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.7k
- Avg merge
- 21h 30m
- Merged PRs (30d)
- 27
Description
## 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()`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.