private void decodeEvents(final Document document, LogDataCollector collector, ParsingContext parsingContext) {

    NodeList eventList = document.getElementsByTagName("record");

    for (int eventIndex = 0; eventIndex < eventList.getLength(); eventIndex++) {
      Node eventNode = eventList.item(eventIndex);

      Logger logger = null;
      long timeStamp = 0L;
      Level level = null;
      String threadName = null;
      Object message = null;
      String className = null;
      String methodName = null;
      String exceptionStackTrace = null;

      // format of date: 2003-05-04T11:04:52
      // ignore date or set as a property? using millis in constructor instead
      NodeList list = eventNode.getChildNodes();
      int listLength = list.getLength();

      if (listLength == 0) {
        continue;
      }

      for (int y = 0; y < listLength; y++) {
        Node logEventNode = list.item(y);
        String tagName = logEventNode.getNodeName();

        if (tagName.equalsIgnoreCase("logger")) {
          logger = LoggerFactory.getLogger(getCData(list.item(y)));
        } else if (tagName.equalsIgnoreCase("millis")) {
          timeStamp = Long.parseLong(getCData(list.item(y)));
        } else if (tagName.equalsIgnoreCase("level")) {
          level = Level.parse(getCData(list.item(y)));
        } else if (tagName.equalsIgnoreCase("thread")) {
          threadName = getCData(list.item(y));
        } else if (tagName.equalsIgnoreCase("message")) {
          message = getCData(list.item(y));
        } else if (tagName.equalsIgnoreCase("class")) {
          className = getCData(list.item(y));
        } else if (tagName.equalsIgnoreCase("method")) {
          methodName = getCData(list.item(y));
        } else if (tagName.equalsIgnoreCase("exception")) {
          exceptionStackTrace = getExceptionStackTrace(list.item(y));

        }


      }
      if (message != null && exceptionStackTrace != null) {
        message = message + "\n" + exceptionStackTrace;
      } else if (exceptionStackTrace != null) {
        message = exceptionStackTrace;
      }
      LogData logData = new LogData();
      logData.setLevel(level);
      logData.setClazz(className);
      logData.setId(parsingContext.getGeneratedIdAndIncrease());
      logData.setDate(new Date(timeStamp));
      logData.setLoggerName(Optional.ofNullable(logger).map(Logger::getName).orElse(""));
      logData.setMessage(StringUtils.defaultString(message != null ? message.toString() : ""));
      logData.setThread(threadName);
      logData.setMethod(methodName);
      logData.setLogSource(parsingContext.getLogSource());
      collector.add(logData);

    }
  }
Given a Document, converts the XML into a Vector of LoggingEvents.

@param document XML document
olv-core/src/main/java/pl/otros/logview/importer/UtilLoggingXmlLogImporter.java