On 03/10/2018 17:26, Ralph Goers wrote:
Log4j handles this by capturing the fully qualified class name of the logging
adapter. Obviously, this doesn’t work if the adapter doesn’t pass Log4j the
FQCN, but it does work for the adapters we support. That said, it is very slow
to capture this and is probably the biggest pain point. Log4j recommends not
capturing this information in production environments because it is so slow.
Unfortunately, it seems to have gotten even slower in Java 9+.
Would it be possible to create a small test case to demonstrate the
performance regression that you are seeing? The StackWalker API was
added in Java SE 9 so I can't tell if you are comparing that to
sun.reflect.Reflection::getCallerClass or something else.
-Alan