diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java index bacb0c18d8b..2ee943185e5 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java @@ -72,11 +72,19 @@ public final class StackLocator { } else { o = getCallerClassMethod.invoke(null, 1); if (o == sunReflectionClass) { - System.out.println("WARNING: Unexpected result from sun.reflect.Reflection.getCallerClass(int), adjusting offset for future calls."); + LowLevelLogUtil.log( + "WARNING: Unexpected result from sun.reflect.Reflection.getCallerClass(int), adjusting offset for future calls."); java7u25CompensationOffset = 1; } } } catch (final Exception | LinkageError e) { + if (Constants.JAVA_MAJOR_VERSION > 8) { + LowLevelLogUtil.log( + "WARNING: Runtime environment does not support multi-release JARs. This will impact location-based features."); + } else { + LowLevelLogUtil.log( + "WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact location-based features."); + } getCallerClassMethod = null; java7u25CompensationOffset = -1; }