LogFilePatternReceiver (available in log4j 1.3 alpha) does the heavy lifting (parsing a log file and converting the entries to logging events).
Replace the 'doPost' calls in this receiver with a method that populates your listmodel. The receiver can only 'tail' file:// - based URLs (for now): http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4 j/varia/LogFilePatternReceiver.java?rev=1.24&view=markup There's also VFSLogFilePatternReceiver that can process files accessible via VFS (ssh, etc): http://cvs.apache.org/viewcvs.cgi/logging-chainsaw/src/java/org/apache/l og4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=1.2&view=markup The VFS project is here: http://jakarta.apache.org/commons/vfs/ Scott -----Original Message----- From: Ricardo Lopes [mailto:[EMAIL PROTECTED] Sent: Monday, October 03, 2005 11:28 AM To: [email protected] Subject: Show logs in real time on a Swing Application Hi, I want to include a way of showing the logs on the applications i'm developping. Something simple like pressing a button on my swing interface a showing a window with the contents of the log. I'm currently using a FileAppender with a custom format to save the logs. I would really like to do it this way: 1- Read all the Log and put it on the swing window 2- Register a custom appender (on the fly) that would append the new entries on the window as they are logged 3- When the window is closed the appender is removed Is it posible to do this? Would it affect logging performance anyhow? Thanks, Ricardo Lopes. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
