vy commented on PR #2691:
URL: https://github.com/apache/logging-log4j2/pull/2691#issuecomment-2210702563

   > I saw at `xxxThrowablePatternConverter#format()` we do conditions checking 
whether `event.getThrownProxy() is null`. But when will it be null?
   
   I presume, since `ThrowableProxy` et al. has been added after the 
incarnation of `LogEvent`, its implementation is optional for backward 
compatibility reasons. The default implementation (i.e., `Log4jLogEvent`) 
populates it dynamically when requested. Hence, we should first check if 
`LogEvent#getThrownProxy()` is not null, otherwise create one using 
`ThrowableProxy::new`.
   
   > For `RootThrowablePatternConverter `, I think the passed in 
[ThrowableProxy](https://github.com/alan0428a/logging-log4j2/blob/42459ed966eaa728757e74d7dcfc0fb1953891ca/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java#L63)
 already has the root cause. Do we need to wrap it like what you mentioned?
   
   No, you're right, we don't need to. I confused the behaviour of Pattern 
Layout's `%rEx` with JSON Template Layout's `exceptionRootCause`.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to