GitHub user ZOUG added a comment to the discussion: Exception causes are 
truncated while logging exceptions with line number limit

I was considering to move to `log4j2` from `logback`, whose default behavior 
for `%ex{5}` is printing 5 lines of stack trace for **each exception level 
(including the outermost exception and its causes)**. I wasn't aware of the 
`%rEx` parameter before. So I tried `%rEx{5}` and it shows something like this.

```
java.lang.RuntimeException: Cause
        ... 74 more
Wrapped by: java.lang.RuntimeException: Nested exception
        at com.example.LoggingTest.testLogger(LoggingTest.java:20) 
~[test-classes/:?]
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
 ~[?:?]
```

The cause exception is shown -- which is helpful -- but its stack trace is 
still not printed as expected.

GitHub link: 
https://github.com/apache/logging-log4j2/discussions/3803#discussioncomment-13667884

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@logging.apache.org

Reply via email to