I'm developing open source log viewer OtrosLogViewer. You can use it as library in your application. Take a look at this example.
//Define log4j properties
Properties p = new Properties();
p.put("type", "log4j");
p.put("pattern", "TIMESTAMP LEVEL [THREAD] MESSAGE");
p.put("dateFormat", "yyyy-MM-dd HH:mm:ss,SSS");
Log4jPatternMultilineLogParser logParser = new Log4jPatternMultilineLogParser();
LogImporterUsingParser importerUsingParser = new LogImporterUsingParser(logParser);
importerUsingParser.init(p);
//
ParsingContext context = new ParsingContext();
//Create log collector, it capture all parsed log events
ProxyLogDataCollector dataCollector = new ProxyLogDataCollector();
//Create input stream from file
InputStream in = new FileInputStream("log4j/log4j.txt");
//parse log file
importerUsingParser.importLogs(in, dataCollector, context);