@Override
  public void init(Properties properties) throws InitializationException {
    this.properties = properties;
    String rePattern = properties.getProperty(PROPERTY_REPATTERN);
    logFormat = properties.getProperty(PROPERTY_PATTERN);
    if (!StringUtils.isBlank(logFormat) && rePattern != null) {
      throw new InitializationException(String.format("Conflicting log patterns set (properties %s and %s)", PROPERTY_PATTERN, PROPERTY_REPATTERN));
    }
    if (StringUtils.isBlank(logFormat) && rePattern == null) {
      throw new InitializationException(String.format("Log pattern not set (property %s or %s)", PROPERTY_PATTERN, PROPERTY_REPATTERN));
    }
    timestampFormat = properties.getProperty(PROPERTY_DATE_FORMAT);
    if (StringUtils.isBlank(timestampFormat)) {
      throw new InitializationException(String.format("Date format not set (property %s)", PROPERTY_DATE_FORMAT));
    }
    customLevelDefinitions = properties.getProperty(PROPERTY_CUSTOM_LEVELS, "");
    parserDescription.setDisplayName(properties.getProperty(PROPERTY_NAME, "?"));
    parserDescription.setDescription(properties.getProperty(PROPERTY_DESCRIPTION, "?"));
    parserDescription.setCharset(properties.getProperty(PROPERTY_CHARSET, "UTF-8"));
    trimUnmatchedLines = Boolean.valueOf(properties.getProperty(PROPERTY_TRIM_UNMATCHED_LINES, "true"));
    if (timestampFormat != null) {
      // dateFormat = new SimpleDateFormat(quoteTimeStampChars(timestampFormat));
      timestampPatternText = convertTimestamp();
    }

    if (rePattern == null) {
      initializePatterns();
      createPattern();
    } else {
      try {
        regexpPattern = Pattern.compile(rePattern);
      } catch (PatternSyntaxException pse) {
        throw new InitializationException(String.format(
          "Malformatted regex pattern for '%s' (%s): %s",
          PROPERTY_REPATTERN, rePattern, pse.getDescription()));
      }
      // if custom level definitions exist, parse them
      customLevelsParser = new CustomLevelsParser(customLevelDefinitions);

      Map<Integer, String> groupMap = new HashMap<>();
      Enumeration<String> e = (Enumeration<String>) properties.propertyNames();
      String key = null, val = null;
      int keyLen;
      int dotGroupLen = ".group".length();
      while (e.hasMoreElements()) try {
        key = e.nextElement();
        keyLen = key.length();
        if (keyLen <= dotGroupLen || !key.endsWith(".group")) continue;
        val = properties.getProperty(key);
        groupMap.put(Integer.valueOf(val),
          key.substring(0, keyLen - dotGroupLen));
      } catch (NumberFormatException ne) {
        throw new InitializationException(String.format(
          "Group property '%s.group' set to non-integer: %s",
          key, val));
      }
      if (groupMap.size() < 1)
        throw new InitializationException(
          PROPERTY_REPATTERN + " set but no group properties set.  "
            + "Set group indexes like 'TIMESTAMP.group=1', "
            + "starting with index 1");
      for (int i = 1; i <= groupMap.size(); i++) {
        if (!groupMap.containsKey(Integer.valueOf(i)))
          throw new InitializationException(
            "Group property numbers not consecutive starting at 1");
        matchingKeywords.add(groupMap.get(Integer.valueOf(i)));
      }
      if (matchingKeywords.contains(Log4jPatternMultilineLogParser.MESSAGE)
        && !matchingKeywords.get(matchingKeywords.size() - 1).equals(
        Log4jPatternMultilineLogParser.MESSAGE))
        throw new InitializationException(
          "If MESSAGE group is present, it must be last");
    }

  }
Convert a keyword-to-values map to a LoggingEvent

@param fieldMap
@param exception

@return logging event
olv-core/src/main/java/pl/otros/logview/parser/log4j/Log4jPatternMultilineLogParser.java