Marcono1234 created LOG4J2-3593:
-----------------------------------
Summary: StackLocator Reflection.getCallerClass warning is
misleading / incorrect
Key: LOG4J2-3593
URL: https://issues.apache.org/jira/browse/LOG4J2-3593
Project: Log4j 2
Issue Type: Bug
Affects Versions: 2.17.2
Reporter: Marcono1234
When the pre-Java 9 {{StackLocator}} is used, but {{Reflection.getCallerClass}}
is missing, the following warning is printed to console:
{quote}
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will
impact performance.
{quote}
This can for example occur when a JAR with dependencies is created but the
Log4j Java 9 specific code is not included, or {{Multi-Release: true}} is not
set in the manifest (see also LOG4J2-2834).
The issue is that the warning is misleading or incorrect. It suggests that
Log4j is still fully functional, but as seen with LOG4J2-2834, certain
functionality breaks (such as {{LogManager.getLogger()}}).
So maybe the underlying issue here is that the warning is correct, but there is
a bug in {{StackLocator}} and it should actually fall back to using {{new
Throwable().getStackTrace()}}?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)