public static ListAppender<ILoggingEvent> getListAppenderForClasses(@Nullable Class<?>... classList) {

        ListAppender<ILoggingEvent> loggingEventListAppender = new ListAppender<>();
        loggingEventListAppender.start();

        if (classList == null) {
            return loggingEventListAppender;
        }

        Arrays.stream(classList)
                .map(clazz -> (Logger) LoggerFactory.getLogger(clazz))
                .forEach(log -> log.addAppender(loggingEventListAppender));

        return loggingEventListAppender;
    }
Class to test proper @Slf4j logging.

@author Andjelko Perisic (andjelko.perisic@gmail.com)
tests/src/test/java/net/devh/boot/grpc/test/util/LoggerTestUtil.java