ppkarwasz commented on code in PR #1147:
URL: https://github.com/apache/logging-log4j2/pull/1147#discussion_r1032908020
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java:
##########
@@ -786,7 +786,7 @@ public LogEventProxy(final LogEvent event, final boolean
includeLocation) {
this.thrownProxy = event.getThrownProxy();
this.contextData = memento(event.getContextData());
this.contextStack = event.getContextStack();
- this.source = includeLocation ? event.getSource() : null;
+ this.source = includeLocation || !event.isIncludeLocation() ?
event.getSource() : null;
Review Comment:
This line assumes that `event.getSource()` will not compute any location
information if `isIncludeLocation()` is `false`. This is true for our
implementations of `LogEvent`, but is not required by the specification
(Javadoc).
--
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]