void (String prefix) { var options = EnumSet.of(StackWalker.Option.SHOW_HIDDEN_FRAMES, StackWalker.Option.SHOW_REFLECT_FRAMES); var trace = StackWalker.getInstance(options).walk(stack -> stack.skip(1).limit(10) .map(frame -> " " + frame.toStackTraceElement()) .collect(Collectors.joining("\n", prefix + "; called from:\n", "\n ..."))); LOG.info(trace); }