I have come across your project and it is a nice job, however ideally I would like something that takes a native Log4j conversion pattern (e.g., %-5p [%t]: %m%n
) and a file formatted using that pattern, and reads the corresponding information.
Essentially, I am looking for the reverse of the Layout.format(LoggingEvent)
method of the base Layout class of Log4j. This method produces a String that is stored in the log file, so the reverse operation would be able to parse that file and create LoggingEvent objects, or something similar (something like a deserialization procedure).
Thanks!
EDIT: The conversion is straightforward, by just doing
LogFilePatternLayoutBuilder.getLogFormatFromPatternLayout(conversionPattern);
via the Chainsaw class org.apache.log4j.chainsaw.LogFilePatternLayoutBuilder.