You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Flowdalic (via GitHub)" <gi...@apache.org> on 2023/09/06 08:19:08 UTC
[PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Flowdalic opened a new pull request, #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760
Modern Java releases disallow the access to internal sun.* API. There is not much the user can do about it, hence this warning is not actionable and therefore unneeded.
It also does not tag its origin, causing confusion among users about its whereabouts.
--
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
Re: [PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Posted by "Flowdalic (via GitHub)" <gi...@apache.org>.
Flowdalic commented on PR #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760#issuecomment-1708250558
Thanks for your reply, much appreciated. :)
> The typical reason why the Java 8 `StackLocator` runs on JRE 9+ is _shading_
That it probably what happened for me. I am using the [mill build tool for Scala](https://github.com/com-lihaoyi/mill), which is using [Jar Jar Abrams](https://github.com/eed3si9n/jarjar-abrams) for shading. Probably the shading does not support multi release jars.
BTW, see also https://github.com/apache/logging-log4j2/pull/1761.
Note that I like you suggestions, but I will probably not have the resources to implement them.
--
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
Re: [PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on PR #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760#issuecomment-1748840738
@Flowdalic, thank so much for the report and the PR, much appreciated! :bow: Merging it...
--
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
Re: [PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Posted by "vy (via GitHub)" <gi...@apache.org>.
vy merged PR #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760
--
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
Re: [PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Posted by "Flowdalic (via GitHub)" <gi...@apache.org>.
Flowdalic commented on PR #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760#issuecomment-1748898000
> @Flowdalic, thank so much for the report and the PR, much appreciated! 🙇 Merging it...
Thanks for working on an improved solution and merging this. Unfortunately, I only discovered now that the commit message is incomplete and may blames the wrong entity for missing multi-release JAR support. See my follow up PR at https://github.com/apache/logging-log4j2/pull/1833
--
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
Re: [PR] Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #1760:
URL: https://github.com/apache/logging-log4j2/pull/1760#discussion_r1316964203
##########
log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java:
##########
@@ -77,7 +77,6 @@ public final class StackLocator {
}
}
} catch (final Exception | LinkageError e) {
- System.out.println("WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.");
Review Comment:
I would rather keep the warning, but:
- use `LowLevelLogUtil#log` instead of `System.out.println`,
- differentiate the message according to `Constants#JAVA_MAJOR_VERSION`:
- if the version is <= 8 warn about "sun.reflect.Reflection.getCallerClass is not supported. This will impact location-based features.",
- if the version is > 8 warn about "Runtime environment does not support multi-release JARs. This will impact location-base features."
--
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