@Override
  public LogData parse(String line, ParsingContext parsingContext) {

    final StringBuilder unmatchedLog = parsingContext.getUnmatchedLog();
    if (unmatchedLog.length() == 0 && !(line.matches("[,\\s\u0000]*\\{.*"))) {
      return null;
    }

    if (unmatchedLog.length() == 0 && (line.matches("[,\u0000].*"))) {
      unmatchedLog.append(line.substring(1)).append("\n");
    } else {
      unmatchedLog.append(line).append("\n");
    }

    String s = unmatchedLog.toString();
    try {
      Validator.validate(s);
      final Gson gson = new GsonBuilder()

        .registerTypeAdapter(new TypeToken<Thrown>() {
        }.getType(), new ThrownDeserializer())
        .create();

      final Log4j2JsonEvent log4j2JsonEvent = gson.fromJson(s, Log4j2JsonEvent.class);

      unmatchedLog.setLength(0);

      final Optional<Source> source = Optional.ofNullable(log4j2JsonEvent.getSource());

      final Optional<String> exception = Optional
        .ofNullable(log4j2JsonEvent.getThrown())
        .map(Thrown::getStacktrace);

      final long timestamp = Optional.ofNullable(log4j2JsonEvent.getInstant())
        .map(Log4j2JsonEvent.Instant::timestamp)
        .orElse(log4j2JsonEvent.getTimeMillis());

      return new LogDataBuilder()
        .withLevel(levelMap.get(log4j2JsonEvent.getLevel()))
        .withDate(new Date(timestamp))
        .withLoggerName(log4j2JsonEvent.getLoggerName())
        .withClass(log4j2JsonEvent.getLoggerName())
        .withMessage(log4j2JsonEvent.getMessage() + exception.map(e -> "\n" + e).orElse(""))
        .withThread(log4j2JsonEvent.getThread())
        .withMethod(source.map(Source::getMethod).orElse(""))
        .withFile(source.map(Source::getFile).orElse(""))
        .withLineNumber(source.map(s1 -> s1.getLine().toString()).orElse(""))
        .withProperties(log4j2JsonEvent.getContextMap())
        .build();

    } catch (JSONException ignored) {
    }

    return null;
  }
Parser of log in json format. It can skip if between json object are some junk (from standard output). From properties
are taken mappings from Json ~xpath to LogData fields. For example if Json field logMessage contains information about
message, it should be written as message=logMessage
olv-core/src/main/java/pl/otros/logview/parser/json/log4j2/Log4j2JsonLogParser.java