You can use a different layout and log to an additional appender which can 
easily be read by log4j like Serialized.

Gary 

<div>-------- Original message --------</div><div>From: Behrooz Nobakht 
<[email protected]> </div><div>Date:01/05/2015  06:01  (GMT-05:00) 
</div><div>To: [email protected] </div><div>Cc:  </div><div>Subject: 
API to read a log file to a Collection of LogEvent? </div><div>
</div>Hi,

For example, I have an audit log file with certain structure (pattern layout). 
I want to replay the log that can be turned into certain domain objects.
I am interested to read the log file knowing the pattern layout 
into a Collection or Stream of LogEvent using Apache Log4j 2?

I understand that LogEvent may be an overkill for such purpose and potentially
simple string processing per line would do the job. Just want to make sure 
we can take advantage of an existing API if any.

Thanks,
Behrooz

Reply via email to