org.apache.log4j.chainsaw.ApplicationPreferenceModel model = new org.apache.log4j.chainsaw.ApplicationPreferenceModel();
org.apache.log4j.chainsaw.LogUI.createChainsawGUI(model,null);
gives me a
java.lang.IllegalArgumentException: timeout value is negative
at java.lang.Object.wait(Native Method)
at org.apache.log4j.chainsaw.ChainsawAppenderHandler$WorkQueue$WorkerThread.run(Unknown Source)
and all events but the first are missing while this one
org.apache.log4j.chainsaw.ApplicationPreferenceModel model = new org.apache.log4j.chainsaw.ApplicationPreferenceModel();
org.apache.log4j.chainsaw.prefs.SettingsManager.getInstance().configure(model);
org.apache.log4j.chainsaw.LogUI.createChainsawGUI(model,null);
seems to work.
Does there exist Hello World sourcecode that uses Chainsaw as a loggerviewer that I could get?
Best regards, Carsten
Paul Smith schrieb:
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
