logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stauffer" <stauffer.ja...@gmail.com>
Subject Re: log4j / JTextArea - how to initialize/implement?
Date Wed, 06 Sep 2006 18:19:47 GMT
Make the appender do nothing if there is no writer set.  Then after
you create the JTextAreaWriter you could set it on the appender.

On 9/6/06, Maciej Zywno <m.zywno@gmail.com> wrote:
> Hiya,
> I'm developing a Swing based application. I want to use Log4J to log
> events not only to files but also to JTextArea instance present on one
> of tabs. AFAIK I should use JTextAreaWriter(extends
> java.io.Writer) and a custom class that extends
> org.apache.log4j.WriterAppender. (btw if you already see the better
> solution - let me know)
> The problem for me is how to initialize such an appender. At the moment
> when log4j initializes, there is no JTextArea instance yet. Sometime
> later, during application lifetime, when a JTextArea instance is
> created, I cannot see how to reconfigure(or create?) my custom appender
> to add logging to that JTextArea instance.
> Is it possible? Thanks for any hints
> Maciej Zywno
> --
> zywy

James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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

View raw message