Return-Path: Delivered-To: apmail-logging-general-archive@www.apache.org Received: (qmail 79324 invoked from network); 20 May 2010 16:15:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 May 2010 16:15:59 -0000 Received: (qmail 62555 invoked by uid 500); 20 May 2010 16:15:59 -0000 Delivered-To: apmail-logging-general-archive@logging.apache.org Received: (qmail 62429 invoked by uid 500); 20 May 2010 16:15:58 -0000 Mailing-List: contact general-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Logging General" List-Id: Delivered-To: mailing list general@logging.apache.org Received: (qmail 62421 invoked by uid 99); 20 May 2010 16:15:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 16:15:58 +0000 X-ASF-Spam-Status: No, hits=-1692.7 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 16:15:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 697902388903; Thu, 20 May 2010 16:15:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r946685 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/help/ Date: Thu, 20 May 2010 16:15:37 -0000 To: general@logging.apache.org From: sdeboy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100520161537.697902388903@eris.apache.org> Author: sdeboy Date: Thu May 20 16:15:36 2010 New Revision: 946685 URL: http://svn.apache.org/viewvc?rev=946685&view=rev Log: Support use of 'log4j.configuration' system property to configure Chainsaw (only if the automatic configuration URL is NOT specified in application-wide preferences). The log4j.configuration system property must provide the -URL- of the Chainsaw configuration file. Also fixed a bug which prevented clearing of the automatic configuration URL field (the auto-config field must be empty to use the log4j.configuration system property) Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java?rev=946685&r1=946684&r2=946685&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java Thu May 20 16:15:36 2010 @@ -404,11 +404,13 @@ public class ApplicationPreferenceModel */ public final void setConfigurationURL(String configurationURL) { - //don't add empty entries + //don't add empty entries, but allow the current configuration URL to be set to an empty string + Object oldValue = this.configurationURL; if (configurationURL == null || configurationURL.trim().equals("")) { + this.configurationURL = ""; + firePropertyChange("configurationURL", oldValue, this.configurationURL); return; } - Object oldValue = this.configurationURL; //add entry to MRU list if (!configurationURLs.contains(configurationURL)) { if (configurationURLs.size() == CONFIGURATION_URL_ENTRY_COUNT) { Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java?rev=946685&r1=946684&r2=946685&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java Thu May 20 16:15:36 2010 @@ -539,7 +539,10 @@ public static void main(String[] args) { public boolean verify(JComponent input) { try { - new URL((String)configurationURL.getSelectedItem()); + String selectedItem = (String)configurationURL.getSelectedItem(); + if (selectedItem != null && !(selectedItem.trim().equals(""))) { + new URL(selectedItem); + } } catch (Exception e) { return false; } Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java?rev=946685&r1=946684&r2=946685&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java Thu May 20 16:15:36 2010 @@ -108,6 +108,7 @@ import org.apache.log4j.chainsaw.prefs.S import org.apache.log4j.chainsaw.prefs.SettingsListener; import org.apache.log4j.chainsaw.prefs.SettingsManager; import org.apache.log4j.chainsaw.receivers.ReceiversPanel; +import org.apache.log4j.helpers.Constants; import org.apache.log4j.net.SocketNodeEventListener; import org.apache.log4j.plugins.Plugin; import org.apache.log4j.plugins.PluginEvent; @@ -384,17 +385,23 @@ public class LogUI extends JFrame implem }); String config = model.getConfigurationURL(); - if(config!=null && (!(config.trim().equals("")))) { - config = config.trim(); - try { - URL configURL = new URL(config); - logUI.loadConfigurationUsingPluginClassLoader(configURL); - }catch(MalformedURLException e) { - logger.error("Initial configuration - failed to convert config string to url", e); - } + if (config == null || (config.trim().equals(""))) { + logger.info("No auto-configuration file found in ApplicationPreferenceModel - attempting to use log4j.configurationURL system property"); + config = System.getProperty(Constants.DEFAULT_CONFIGURATION_KEY); } - - //register a listener to load the configuration when it changes (avoid having to restart Chainsaw when applying a new configuration) + + if (config != null && (!config.trim().equals(""))) { + config = config.trim(); + try { + URL configURL = new URL(config); + logger.info("Using '" + config + "' for auto-configuration"); + logUI.loadConfigurationUsingPluginClassLoader(configURL); + } catch(MalformedURLException e) { + logger.error("Initial configuration - failed to convert config string to url", e); + } + } + + //register a listener to load the configuration when it changes (avoid having to restart Chainsaw when applying a new configuration) //this doesn't remove receivers from receivers panel, it just triggers DOMConfigurator.configure. model.addPropertyChangeListener("configurationURL", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { @@ -411,11 +418,6 @@ public class LogUI extends JFrame implem } }}); - if (config == null || config.trim().equals("")) { - logger.info("No auto-configuration file found within the ApplicationPreferenceModel"); - } else { - logger.info("Using '" + config + "' for auto-configuration"); - } LogManager.getRootLogger().setLevel(Level.TRACE); logUI.activateViewer(); Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html?rev=946685&r1=946684&r2=946685&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html (original) +++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html Thu May 20 16:15:36 2010 @@ -10,6 +10,10 @@ NOTE: The mechanism and format used to persist settings in Chainsaw is subject to change. If you are experiencing problems displaying events in Chainsaw, please delete everything in the $user.dir/.chainsaw directory and restart Chainsaw.

2.0

+

20 May 2010

+
    +
  • For users who would like to specify the Chainsaw configuration file from the command line, the 'log4j.configuration' system property will now be used if the automatic configuration URL is NOT specified in application-wide preferences. The log4j.configuration system property must provide the -URL- of the Chainsaw configuration file.
  • +

13 May 2010

  • Added ability to quickly define color rules for field under mouse pointer in the table as well as for the selected logger in the logger tree (uses default color chooser dialog).
  • @@ -192,7 +196,6 @@ not to provide this, be on the look out
    • Changed the default order of columns in Chainsaw to first display ID, level, logger, message and exception
    • Added default level expressions (example: LEVEL == DEBUG) to the 'refine focus' combobox
    • -
    • Modified Chainsaw initialization logic to load Chainsaw-specified config when specified. NOTE: Chainsaw will load configurations from BOTH the log4j.configuration system property and Chainsaw's automatic configuration URL if the two are specified
    • Corrected date pattern format bug (was displaying minutes where it should be displaying months in the detail panel)