Are you just displaying the msgs (no sorting/searching/filtering)?

If that's the case, I wouldn't use serialized LoggingEvents.  I'd create my own 
serializable with just the information I needed (a message and maybe a 
'category') and create my own table model backed by a collection of those 
objects.

If you were interested in supporting some of Chainsaw's features, you might 
want to dive into Chainsaw's source and see what you could reuse.

You copy log4j's 'cyclicbuffer' class and modify the backing collection if 
you'd like cyclic buffering of your own objects.

Scott


-----Original Message-----
From:   Jeff Drew [mailto:[EMAIL PROTECTED]
Sent:   Fri 6/3/2005 11:47 AM
To:     Log4J Users List
Cc:     
Subject:        right design?
I'd appreciate some feedback on whether the following solution sounds good.  I 
read Ceki's book to come up with this solution, but would like to know whether 
I'm heading for a disaster. 

PROBLEM: I want to add a little status panel to my desktop GUI. Some status 
messages would be generated locally while others would be transmitted from the 
server.  These are intended to be low priority, best effort indicators.

SOLUTION: 
Summary: Use log4j LoggingEvents as status messages.  Present LoggingEvents 
with XML Layout in a Swing JTable, possibly using the Chainsaw interface

1. In the desktop GUI, create  LoggingEvents using a logger and custom appender 
that:
    - Formats a LoggingEvent into XML, then adds it to a local LinkedList 
(allows me to maintain sequence and limit size)

for example:
    statusLogger.info("sample status message");   /* would result in a 
LoggingEvent with the text "sample status message" inserted LinkedList */

2. In the server, create LoggingEvents using the same logger and custom 
appender class, then transmit them to the desktop using Object Output 
Stream(been using that for years). The desktop would add the received 
LoggingEvents to the LinkedList described in #1.

3. Input those LinkedList members to Chainsaw for display


QUESTIONS TO log4j EXPERTS:
A. Is it appropriate to use LoggingEvent as a message as described above? If 
yes, should it be output from a custom appender? 
B. Would you recommend using the Chainsaw gui or is there some mini-Chainsaw 
commonly used?

Thanks!

Jeff 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to