You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Matt Munz <mm...@apelon.com> on 2004/08/18 16:46:12 UTC

Embed log output viewer into a Swing/Desktop application

Hi all,

  I'm trying to show my application's log output in a JPanel or
something similar, and I'm looking for suggestions, and especially any
third-party widgets that I could embed into my app.  Here are my
requirements.

  1) Uses the latest stable log4j release (1.2.8) w/o modification
  2) Does not use sockets.  All communication is in-vm*
  3) Easy to set up development-wise (Plug-n-play)
  4) No fancy features required.  It should just work.
  5) No SWT / native code 
  6) Must not get bogged down with 1-10K messages 

* I had threading issues when I tried to embed Chainsaw, so I'd like to
avoid anything tricky in this dept.  I am willing to be convinced,
however, if someone can show me a fool-proof example of sending the
messages over a socket instead of in-vm.

  At a minimum, some sort of Java console widget (system.out redirect to
a JPanel) would likely meet my needs, but more sophistocated tools are
welcome.  Has anyone seen a widget that might fit my needs?

  - Matt


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


RE: Embed log output viewer into a Swing/Desktop application

Posted by Paul Smith <ps...@aconex.com>.
You could probably adapt the org.apache.log4j.chainsaw.MessageCenter and
MessageCenterAppender classes available from HEAD to suit your needs.
The MessageCenterAppender is designed to be attached like a normal appender
to any logger, and stores the events in a ListModel.  MessageCenter then
just adds that appender to a Chainsaw specific logger for internal events,
allowing the user to see what's happening inside Chainsaw.  If you
'borrowed' those classes, you'd probably not have to change much at all to
suit your requirements (although I can't verify what would happen with 10000
events in it).
Hope that helps.
Paul Smith

> -----Original Message-----
> From: Matt Munz [mailto:mmunz@apelon.com]
> Sent: Thursday, August 19, 2004 12:46 AM
> To: log4j-user@logging.apache.org
> Subject: Embed log output viewer into a Swing/Desktop application
> 
> Hi all,
> 
>   I'm trying to show my application's log output in a JPanel or
> something similar, and I'm looking for suggestions, and especially any
> third-party widgets that I could embed into my app.  Here are my
> requirements.
> 
>   1) Uses the latest stable log4j release (1.2.8) w/o modification
>   2) Does not use sockets.  All communication is in-vm*
>   3) Easy to set up development-wise (Plug-n-play)
>   4) No fancy features required.  It should just work.
>   5) No SWT / native code
>   6) Must not get bogged down with 1-10K messages
> 
> * I had threading issues when I tried to embed Chainsaw, so I'd like to
> avoid anything tricky in this dept.  I am willing to be convinced,
> however, if someone can show me a fool-proof example of sending the
> messages over a socket instead of in-vm.
> 
>   At a minimum, some sort of Java console widget (system.out redirect to
> a JPanel) would likely meet my needs, but more sophistocated tools are
> welcome.  Has anyone seen a widget that might fit my needs?
> 
>   - Matt
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org



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