You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/11/27 10:49:39 UTC

[GitHub] [logging-log4j2] ppkarwasz commented on a diff in pull request #1147: [LOG4J2-3638] Provide a Maven plugin to inline location information

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: notifications-unsubscribe@logging.apache.org

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