logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: how to use sawchain2?
Date Sat, 31 Jan 2004 01:23:50 GMT
If you're interested in launching Chainsaw2 when your app starts, you could launch is as an
appender:

appender: org.apache.log4j.chainsaw.ChainsawAppender
viewerClass param: org.apache.log4j.chainsaw.LogUI

Take care,
Scott



-----Original Message-----
From:	Paul Smith [mailto:paul.smith@lawlex.com.au]
Sent:	Fri 1/30/2004 4:16 PM
To:	Log4J Developers List
Cc:	log4j-dev@jakarta.apache.org; log4j-user@jakarta.apache.org
Subject:	Re: how to use sawchain2?
Try:

org.apache.log4j.chainsaw.LogUI.createChainsawGUI(ApplicationPreferenceModel model,
    Action shutdownAction) 

method.

You will need an instance of the ApplicationPreferenceModel (create a
blank one in code and customise it if you need it) and a Swing Action
that can handle when the user chooses to "exit" chainsaw. 

The default action will exit the VM so you should provide an Action that
hides the LogUI frame.  You will also then need in your app a way to
make the LogUI frame visible again.

cheers,

Paul Smith


On Sat, 2004-01-31 at 09:24, Carsten Hammer wrote:
> Hi,
> I tried to instantiate ChainsawCentral like this:
> 
> import java.awt.*;
> import javax.swing.*;
> import org.apache.log4j.chainsaw.plugins.*;
> 
> public class LoggingDialog extends JDialog {
>    private JPanel panel1 = new JPanel();
>    private BorderLayout borderLayout1 = new BorderLayout();
>    private ChainsawCentral chainsaw = new 
> org.apache.log4j.chainsaw.plugins.ChainsawCentral();
> 
> 
>    public LoggingDialog(Frame frame, String title, boolean modal) {
>      super(frame, title, modal);
>      try {
>        jbInit();
>        pack();
>      }
>      catch(Exception ex) {
>        ex.printStackTrace();
>      }
>    }
> 
>    public LoggingDialog() {
>      this(null, "", false);
>    }
>    private void jbInit() throws Exception {
> 
>      panel1.setLayout(borderLayout1);
>      getContentPane().add(panel1);
>      panel1.add(chainsaw, BorderLayout.NORTH);
> 
>    }
> }
> 
> Unfortunatly it does not work. I get the Dialog but there are no logs 
> written to it.
> I tried doing things like
> 
> BasicConfigurator.configure(new 
> org.apache.log4j.chainsaw.ChainsawAppender());
> org.apache.log4j.Logger.getRootLogger().addAppender(new 
> org.apache.log4j.chainsaw.ChainsawAppender());
> 
> before and added a org.apache.log4j.netSocketAppender to my 
> log4j.properties nothing helped.
> 
> This all using log4j-1.3alpha.jar and log4j-chainsaw-1.3alpha.jar.
> 
> Has anybody here been able to use chainsaw within a custom application?
> How?
> Best regards,
> Carsten
> 
> 
> 
> ---------------------------------------------------------------------
> 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





Mime
View raw message