I need to append log4j content to a Swing component (JTextArea or similar). Is there a common way to do this?
+4
A:
Thanks to Google, I've obviously discovered the Log4j-Swing-Appender.
Nate
2009-08-31 19:08:16
+3
A:
Instead of introducing an external library, I ended up editing the log4j.properties file to include the following:
log4j.rootCategory=DEBUG, app
log4j.appender.app=path.to.class.extending.WriterAppender
Then I employed an observer pattern to post the data into my GUI's JTextArea.
Nate
2009-09-04 16:28:16
+1
A:
to make the JScrollPane wrapping the target component (e.g. JTextArea) automatically scroll down to show the latest log entries, consider calling:
org.apache.log4j.lf5.viewer.LF5SwingUtils.makeVerticalScrollBarTrack(scrollPane);
orcus
2010-02-11 09:02:49