I have many log files and I have a few log4j configurations (different ConversionPattern
formats for file appenders).
I would like to write a script/test which is able to group log files by a ConversionPattern
which was used to write a file. The bit I'm missing is how to implement something like:
boolean logToPatternMatcher.matches(String conversionPattern, String logFileEntry)
Is it possible with Log4j API?
The above method should return true for a given:
String conversionPattern = "%d{ISO8601} %-5p [%-16.16t][%c] %m%n"
String logFileEntry = "2015-02-12 00:02:38,023 WARN [pool-58-thread-1][some.package.name.ConvertingPublisher] Document [type: app.MessageProcessed, id: 1063_1_20150128072222800] DUPLICATED."