@Test
  public void testCustomCharset() throws Throwable {
    // given
    Properties p = new Properties();
    // Mixing sequence on purpose to test that sequence does not matter.
    p.put("MESSAGE.group", "4");
    p.put("LEVEL.group", "2");
    p.put("TIMESTAMP.group", "1");
    p.put("THREAD.group", "3");
    p.put("type", "log4j");
    p.put("rePattern", "(\\S+ \\S+) +(\\S+) +\\[\\s*(\\S+)\\s*\\] +(.*)");
    p.put("dateFormat", "yyyy-MM-dd HH:mm:ss,SSS");
    p.put("name", "windows-1250");
    p.put("charset", "windows-1250");
    InputStream in = loadLog("log4j/log4j_pl.txt");
    Log4jPatternMultilineLogParser logParser = new Log4jPatternMultilineLogParser();
    LogImporterUsingParser importerUsingParser = new LogImporterUsingParser(logParser);
    importerUsingParser.init(p);
    ParsingContext context = new ParsingContext();
    importerUsingParser.initParsingContext(context);

    // when
    ProxyLogDataCollector dataCollector = new ProxyLogDataCollector();
    importerUsingParser.importLogs(in, dataCollector, context);

    // then

    assertEquals("windows-1250", logParser.getParserDescription().getCharset());
    LogData[] logDatas = dataCollector.getLogData();
    assertEquals(6, logDatas.length);
    assertEquals('a', logDatas[2].getMessage().toCharArray()[0]);
    assertEquals(261, logDatas[2].getMessage().toCharArray()[1]);

    assertEquals('e', logDatas[3].getMessage().toCharArray()[0]);
    assertEquals(281, logDatas[3].getMessage().toCharArray()[1]);

    assertEquals('z', logDatas[4].getMessage().toCharArray()[0]);
    assertEquals(380, logDatas[4].getMessage().toCharArray()[1]);

    assertEquals('l', logDatas[5].getMessage().toCharArray()[0]);
    assertEquals(322, logDatas[5].getMessage().toCharArray()[1]);
  }
This class tests the "rePattern" alternative of Log4jPatternMultilineLogParser.
(As opposed to the more simple "pattern" system).
olv-core/src/test/java/pl/otros/logview/parser/log4j/Log4jPatternRegexParserTest.java