Reputation: 12331
I'm looking for a java logging framework which enables to declare your own grammar and automatically generates the associated parser.
Ideally, I would like to use log4j and generates a parser and then be able to manipulate these logs as objects.
I've seen there's a scanner generator for log4j based on events but no parser.
I guess they've a parser inside Chainsaw but i wasn't able to find it.
thanks.
Upvotes: 0
Views: 132
Reputation: 1736
log4j's LogFilePatternReceiver will convert a text log file into LoggingEvents according to a format you provide, and forward those events to any registered appenders.
You could configure log4j programmatically with the receiver as well as a custom appender (possibly using something similar to VectorAppender here: http://logging.apache.org/log4j/companions/extras/xref-test/org/apache/log4j/VectorAppender.html).
Upvotes: 1
Reputation: 6810
I am not aware of a logging framework like this. If I were doing this, I would setup log4j to log XML or use the built in database appender. From there it would be pretty easy to write a parser to generate objects.
Upvotes: 1