logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierrick Brihaye <pierrick.brih...@free.fr>
Subject Sending logs to a LogPanel
Date Sat, 01 Oct 2005 16:51:28 GMT
Hi,

Excuse me for this probably basic question, but I can't any valuable 
information, probably because of the API changes.

I have a Swing-based application with this method :

private static void initLog4J() {
   final Properties props = new Properties();
   props.setProperty("log4j.rootCategory", "DEBUG, CONSOLE");
   props.setProperty("log4j.appender.CONSOLE", 
"org.apache.log4j.ConsoleAppender"); 
props.setProperty("log4j.appender.CONSOLE.layout","org.apache.log4j.PatternLayout") 
;
   PropertyConfigurator.configure(props);
}

When debugging, this outputs the logs on my Eclipse console. Fine.

Now, I'd like to redirect these logs to my application's GUI.

As a try, I've evaluated Chainsaw, which is beautifully designed ;-)

private static void initLog4J() {
   final Properties props = new Properties();
   props.setProperty("log4j.rootCategory", "DEBUG, chainsaw");
   props.setProperty("log4j.appender.chainsaw", 
"org.apache.log4j.net.SocketAppender");
   props.setProperty("log4j.appender.chainsaw.RemoteHost", "localhost");
   props.setProperty("log4j.appender.chainsaw.Port","4445");
   props.setProperty("org.apache.log4j.spi.location","true");
   PropertyConfigurator.configure(props);
}

No problem. It's exactly what I want.

Now, I'd like to have a chainsaw-like GUI in my app.

Unfortunately, in version 1.2.13, MyTableModel is package protected so 
that I can't se it without rewriting it.

Thus, I've switched to version 1.3-alpha6 where there is a nicely 
designed LogPanel.

Now, the question is : how to send the logs to my LogPanel instance ?

Cheers,

p.b.


---------------------------------------------------------------------
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