logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: Show logs in real time on a Swing Application
Date Mon, 03 Oct 2005 18:41:04 GMT
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:A448@alunos.ipca.pt] 
Sent: Monday, October 03, 2005 11:28 AM
To: log4j-user@logging.apache.org
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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


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


Mime
View raw message