logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r985797 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: LogUI.java receivers/PluginPropertyEditorPanel.java vfs/VFSLogFilePatternReceiver.java
Date Mon, 16 Aug 2010 06:14:38 GMT
Author: sdeboy
Date: Mon Aug 16 06:14:38 2010
New Revision: 985797

URL: http://svn.apache.org/viewvc?rev=985797&view=rev
Log:
Minor bug fixes
 - Fixed bug preventing non-blank receiver properties from being set to blank (except for
'name' field)
 - Now only logging in VFS receiver panel if the file size grows or the file is truncated
(not every time the file is examined for changes)
 - Fixed bug causing a specified receiver configuration to be loaded twice if loaded from
the receiver configuration/selection screen
 - Updated LogFilePatternReceiver timestamp regexp support to escape dots in timestamps

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java

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=985797&r1=985796&r2=985797&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 Mon Aug 16 06:14:38
2010
@@ -1541,9 +1541,9 @@ public class LogUI extends JFrame implem
                   public void run() {
                     if (receiverConfigurationPanel.isDontWarnMeAgain()) {
                         applicationPreferenceModel.setConfigurationURL(finalURL.toExternalForm());
+                    } else {
+                        loadConfigurationUsingPluginClassLoader(finalURL);
                     }
-                    loadConfigurationUsingPluginClassLoader(finalURL);
-
 
                     receiversPanel.updateReceiverTreeInDispatchThread();
                   }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java?rev=985797&r1=985796&r2=985797&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
Mon Aug 16 06:14:38 2010
@@ -349,7 +349,8 @@ public class PluginPropertyEditorPanel e
 
 
             if (columnIndex == 1) {
-                if (descriptors[rowIndex].getName().toLowerCase().equals("name") &&
aValue == null || aValue.toString().trim().equals("")) {
+                //ensure name is set
+                if (descriptors[rowIndex].getName().toLowerCase().equals("name") &&
(aValue == null || aValue.toString().trim().equals(""))) {
                     logger.error("Name required");
                     return;
                 }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java?rev=985797&r1=985796&r2=985797&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
Mon Aug 16 06:14:38 2010
@@ -399,6 +399,7 @@ public class VFSLogFilePatternReceiver e
                         fileObject = fileSystemManager.resolveFile(getFileURL(), opts);
 
                         //file may not exist..
+                        boolean fileLarger = false;
                         if (fileObject != null && fileObject.exists()) {
                             try {
                                 //available in vfs as of 30 Mar 2006 - will load but not
tail if not available
@@ -406,9 +407,6 @@ public class VFSLogFilePatternReceiver e
                             } catch (Error err) {
                                 getLogger().info(getPath() + " - unable to refresh fileobject",
err);
                             }
-                            if (lastFileSize == 0) {
-                                getLogger().info(getPath() + " - loading file");
-                            }
                             //could have been truncated or appended to (don't do anything
if same size)
                             if (fileObject.getContent().getSize() < lastFileSize) {
                                 reader = new InputStreamReader(fileObject.getContent().getInputStream());
@@ -416,6 +414,7 @@ public class VFSLogFilePatternReceiver e
                                 lastFileSize = 0; //seek to beginning of file
                                 lastFilePointer = 0;
                             } else if (fileObject.getContent().getSize() > lastFileSize)
{
+                                fileLarger = true;
                                 RandomAccessContent rac = fileObject.getContent().getRandomAccessContent(RandomAccessMode.READ);
                                 rac.seek(lastFilePointer);
                                 reader = new InputStreamReader(rac.getInputStream());
@@ -451,7 +450,7 @@ public class VFSLogFilePatternReceiver e
                                 wait(getWaitMillis());
                             }
                         } catch (InterruptedException ie) {}
-                        if (isTailing() && !terminated) {
+                        if (isTailing() && fileLarger && !terminated) {
                             getLogger().debug(getPath() + " - tailing file - file size: "
+ lastFileSize);
                         }
                     } while (isTailing() && !terminated);



Mime
View raw message