code: public static List<ILoggingEvent> capture(Logger logger) {
          CaptureAppender capture = new CaptureAppender();
          ((ch.qos.logback.classic.Logger) logger).addAppender(capture);
          capture.start();
          return capture.captured;
      }
docs: Capture a Logger.
  @param logger the Logger to capture
  @return an updating list of logged events