# HG changeset patch # User Jiri Vanek # Date 1445951616 -3600 # Node ID 6001830b0e1d9b2e0c366d3fd3cd6161aff47ed6 # Parent 8bbb1c9daa4dcc838394ffeea1673dc4263a591c itweb-settings, debugging panel made aware about legacy log and client apps log diff -r 8bbb1c9daa4d -r 6001830b0e1d ChangeLog --- a/ChangeLog Tue Oct 27 13:22:53 2015 +0100 +++ b/ChangeLog Tue Oct 27 14:13:36 2015 +0100 @@ -1,3 +1,12 @@ +2015-10-27 Jiri Vanek + + itweb-settings, debugging panel made aware about legacy log and client apps log + * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: added checboxes for + KEY_ENABLE_APPLICATION_LOGGING_TOFILE and KEY_ENABLE_LEGACY_LOGBASEDFILELOG + Cusotm config directory place was a bit repacked to be more compact and more useful. + * netx/net/sourceforge/jnlp/resources/Messages.properties: added labels + and tooltips for new checkboxes + 2015-10-27 Jiri Vanek Added and by default disabled logging to files for client applications. diff -r 8bbb1c9daa4d -r 6001830b0e1d netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java --- a/netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java Tue Oct 27 13:22:53 2015 +0100 +++ b/netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java Tue Oct 27 14:13:36 2015 +0100 @@ -18,6 +18,7 @@ package net.sourceforge.jnlp.controlpanel; +import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; @@ -56,6 +57,8 @@ DeploymentConfiguration.KEY_ENABLE_LOGGING, DeploymentConfiguration.KEY_ENABLE_LOGGING_HEADERS, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOFILE, + DeploymentConfiguration.KEY_ENABLE_LEGACY_LOGBASEDFILELOG, + DeploymentConfiguration.KEY_ENABLE_APPLICATION_LOGGING_TOFILE, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSTREAMS, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSYSTEMLOG @@ -76,6 +79,19 @@ addComponents(); } + + + private void fileLoggingAct(JCheckBox source, JCheckBox... targets) { + if (source.isSelected()) { + for (JCheckBox target : targets) { + target.setEnabled(true); + } + } else { + for (JCheckBox target : targets) { + target.setEnabled(false); + } + } + } /** * Add components to panel. @@ -119,22 +135,35 @@ } }); - JCheckBox[] debuggingOptions = { + final JCheckBox[] debuggingOptions = { new JCheckBox(Translator.R("DPEnableLogging")), new JCheckBox(Translator.R("DPEnableHeaders")), new JCheckBox(Translator.R("DPEnableFile")), + new JCheckBox(Translator.R("DPEnableLegacyFileLog")), + new JCheckBox(Translator.R("DPEnableClientAppFileLogging")), new JCheckBox(Translator.R("DPEnableStds")), new JCheckBox(Translator.R("DPEnableSyslog")) }; - String[] hints = { + + debuggingOptions[2].addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + fileLoggingAct(debuggingOptions[2], debuggingOptions[3], debuggingOptions[4]); + } + + }); + final String[] hints = { (Translator.R("DPEnableLoggingHint")), (Translator.R("DPEnableHeadersHint")), (Translator.R("DPEnableFileHint", LogConfig.getLogConfig().getIcedteaLogDir())), + (Translator.R("DPEnableLegacyFileLogHint")), + (Translator.R("DPEnableClientAppFileLoggingHint")), (Translator.R("DPEnableStdsHint")), (Translator.R("DPEnableSyslogHint")) }; - ComboItem[] javaConsoleItems = { new ComboItem(Translator.R("DPDisable"), DeploymentConfiguration.CONSOLE_DISABLE), + final ComboItem[] javaConsoleItems = { new ComboItem(Translator.R("DPDisable"), DeploymentConfiguration.CONSOLE_DISABLE), new ComboItem(Translator.R("DPHide"), DeploymentConfiguration.CONSOLE_HIDE), new ComboItem(Translator.R("DPShow"), DeploymentConfiguration.CONSOLE_SHOW), new ComboItem(Translator.R("DPShowPluginOnly"), DeploymentConfiguration.CONSOLE_SHOW_PLUGIN), @@ -167,20 +196,30 @@ c.gridy++; } + //move 5th and 6th checkbox below logsDestination + if (i == 3 || i == 4) { + c.gridx += 1; + if (i == 4) { + c.gridy--; + } + } else { + c.gridx = 0; + } debuggingOptions[i].setSelected(Boolean.parseBoolean(s)); debuggingOptions[i].setActionCommand(properties[i]); debuggingOptions[i].setToolTipText(hints[i]); debuggingOptions[i].addItemListener(this); add(debuggingOptions[i], c); - if (i == 2) { - c.gridx++; - add(logsDestinationTitle, c); + if (i == 2) { + c.gridx++; + JPanel resetTitlePanel = new JPanel(new BorderLayout(10, 0)); + resetTitlePanel.add(logsDestinationReset, BorderLayout.LINE_START); + resetTitlePanel.add(logsDestinationTitle, BorderLayout.LINE_END); + add(resetTitlePanel, c); c.gridx++; add(logsDestination, c); - c.gridx++; - add(logsDestinationReset, c); - c.gridx-=3; + c.gridx -= 2; } } @@ -200,6 +239,7 @@ c.gridy++; c.weighty = 1; add(filler, c); + fileLoggingAct(debuggingOptions[2], debuggingOptions[3], debuggingOptions[4]); } @Override diff -r 8bbb1c9daa4d -r 6001830b0e1d netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Oct 27 13:22:53 2015 +0100 +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Oct 27 14:13:36 2015 +0100 @@ -649,6 +649,10 @@ DPEnableHeaders=Enable headers DPEnableHeadersHint=When this switch is on, each logged message have header with additional information like user, place in code and time DPEnableFile=Enable logging to file +DPEnableLegacyFileLog=Use java.util.logging instead of direct file writing +DPEnableClientAppFileLogging=Fork client applications outputs also to file +DPEnableLegacyFileLogHint=java.util.logging is know to deadlock rarely when used on applications with custom logging extensions +DPEnableClientAppFileLoggingHint=Logging of client apps is known to sometimes not work with java.util.logging on CPFilesLogsDestDir=File logs directory CPFilesLogsDestDirResert=Reset to default DPEnableFileHint=output messages will be saved to file in your {0} directory