logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sasuke <uzumaki.naruto...@gmail.com>
Subject Processing XML log files generated using log4j
Date Tue, 24 Mar 2009 04:58:45 GMT

Hi all.

In my project, I'm using a custom layout which spits out XML elements using
a custom Layout class [which extends Layout] along with a File appender.
Thus I end up with a XML file which looks like:

<event logger="my.pkg.class" timestamp="1236348252343" level="DEBUG"
<message><![CDATA[ log4j message ]]></message>
<!-- an so on -->

The thing I'm trying to achieve here is to write a component which allows me
to query the contents of this file/ parse and process the contents based on
the user supplied criteria. For e.g. the user might want to look at the log
output of yesterday and that too with level as ERROR. In this case, I'd send
back to the user a list of String messages which match the given criteria.
This component would also take in a log4j conversion pattern string and
return the result in the given format.

An approach I can think of is to process the file using SAX and manually
check the attributes and textual content to filter the necessary data.

It would be appreciated if someone could suggest a simpler and less painful
approach for this problem.
View this message in context: http://www.nabble.com/Processing-XML-log-files-generated-using-log4j-tp22674318p22674318.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message