logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Yet another Apender proposal: ListAppender
Date Mon, 18 Oct 2004 12:49:43 GMT

Everything new is old again (or vice versa) ;)  This has been available
forever in the form of the CyclicBuffer, used by the SMTPAppender among
others.  You don't need a whole new Appender just for this.

Yoav Shapira http://www.yoavshapira.com

>-----Original Message-----
>From: Paul Smith [mailto:psmith@aconex.com]
>Sent: Sunday, October 17, 2004 6:43 PM
>To: Log4J Developers List
>Subject: RE: Yet another Apender proposal: ListAppender
>There is also the org.apache.log4j.VectorAppender which is already
there (I
>think it was mainly used for test case purposes, but it's still
>> -----Original Message-----
>> From: Paul Smith [mailto:psmith@aconex.com]
>> Sent: Monday, October 18, 2004 8:04 AM
>> To: Log4J Developers List
>> Subject: RE: Yet another Apender proposal: ListAppender
>> I think I already have just such an appender within the Chainsaw
>> package.  I
>> might refactor it out into the main log4j core too.  The appender
>> implementation exposes a ListModel of it's events it is given.
>> You can see it here:
>> http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apach
>> e/log4j/ch
>> ainsaw/messages/MessageCenterAppender.java?view=markup
>> Here's a TinyURL for the above:
>> http://tinyurl.com/5bvv4
>> cheers,
>> Paul Smith
>> > -----Original Message-----
>> > From: spam2004@meeque.de [mailto:spam2004@meeque.de]
>> > Sent: Saturday, October 16, 2004 6:32 AM
>> > To: log4j-dev@logging.apache.org
>> > Subject: Yet another Apender proposal: ListAppender
>> >
>> >
>> > Hello folks!
>> >
>> > Probably this is getting too frequent now, but I'd like to propose
>> > Appender, too. I guess it is not so sophisticated and usefull as
>> > MultiplexAppender proposed recently, but therefore it is small and
>> > simple. It's only one class, so I've simply attached it to this
>> > The Javadoc coments are rather low quality, but they should give a
>> > idea about how it works.
>> >
>> > My motivation was, to store some LoggingEvents in my application,
>> > that they could be presented in its GUI later. In particular, was
>> > writing some complex import filter, and was logging all import
>> > with Log4j. But I also wanted to give the user some direct feedback
>> > about the progress. Instead of accumulating messages for the GUI
>> > seperately, I decided to use the existing Log4j infrastructure for
>> > This would reduce the additional logging code in the import.
>> >
>> > However the GUI is asynchronous to the import, so I needed to store
>> > LoggingEvents somewhere, and retrive them, whenever they should be
>> > rendered. Of course, I could have used some Appender writing to a
>> > and parse that file to display the events. But in fact the GUI
>> > need to make the events persistent, it just needed them in memory.
So I
>> > wrote that simple ListAppender, which buffers the LoggingEvents in
>> > List. The application using this Appender has full control of the
>> > and can retrive or modify the stored LoggingEvent whenever it
>> >
>> > I could't find any similar Appender in the Log4j API docs. So
>> > you're in need of it, or it is completely unusefull for anyone
>> > Please have a look at it, and decide yourself. If you think any of
>> > code could be usefull for Log4j, please feel free to use it.
>> >
>> > Regards,
>> > Michael
>> >
>> > PS: Thanks for all the other Appenders and Log4j in general. It's
>> > very usefull for me, so far.
>> >
>> >
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message