You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by sd...@apache.org on 2004/07/26 09:39:32 UTC
cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw/receivers PluginPropertyEditorPanel.java
sdeboy 2004/07/26 00:39:32
Modified: src/java/org/apache/log4j/varia
LogFilePatternReceiverBeanInfo.java
LogFilePatternReceiver.java
src/java/org/apache/log4j/chainsaw LogUI.java
ChainsawStatusBar.java
ApplicationPreferenceModelPanel.java
src/xdocs chainsaw.xml
src/java/org/apache/log4j/chainsaw/help release-notes.html
src/java/org/apache/log4j/chainsaw/receivers
PluginPropertyEditorPanel.java
Log:
- Updated LogFilePatternReceiver to rely on a URL for the file location instead of a file name (fileName param replaced with fileURL)
- Added editor support for primitive boolean properties in PluginPropertyEditorPanel (setting the 'tailing' parameter to 'true' on a LogFilePatternReceiver from inside Chainsaw now works)
- Updated width and label of 'automatic configuration' app preference to explicitly show it is a URL
- Updated height of app preferences frame to show all fields completely
- Widened data rate field in status bar
Revision Changes Path
1.7 +1 -1 logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java
Index: LogFilePatternReceiverBeanInfo.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LogFilePatternReceiverBeanInfo.java 7 Jun 2004 20:10:05 -0000 1.6
+++ LogFilePatternReceiverBeanInfo.java 26 Jul 2004 07:39:31 -0000 1.7
@@ -34,7 +34,7 @@
try {
return new PropertyDescriptor[] {
- new PropertyDescriptor("fileName", LogFilePatternReceiver.class),
+ new PropertyDescriptor("fileURL", LogFilePatternReceiver.class),
new PropertyDescriptor("timestampFormat", LogFilePatternReceiver.class),
new PropertyDescriptor("logFormat", LogFilePatternReceiver.class),
new PropertyDescriptor("name", LogFilePatternReceiver.class),
1.14 +23 -17 logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiver.java
Index: LogFilePatternReceiver.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiver.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- LogFilePatternReceiver.java 9 Jul 2004 04:54:28 -0000 1.13
+++ LogFilePatternReceiver.java 26 Jul 2004 07:39:31 -0000 1.14
@@ -17,10 +17,11 @@
package org.apache.log4j.varia;
import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
@@ -44,10 +45,10 @@
/**
* A receiver which supports the definition of the log format using keywords, the
- * contained timestamp using SimpleDateFormat's format support, and the file name
+ * contained timestamp using SimpleDateFormat's format support, and the file URL
*
* FEATURES:
- * specify the file to be processed
+ * specify the URL of the log file to be processed
* specify the timestamp format (if one exists)
* specify the layout used in the log file
* define your file's layout using these keywords along with any text being added as delimiters
@@ -115,7 +116,7 @@
*
* param: "timestampFormat" value="yyyy-MM-d HH:mm:ss,SSS"
* param: "logFormat" value="RELATIVETIME [THREAD] LEVEL LOGGER * - MESSAGE"
- * param: "fileName" value="c:/logs/A4.log"
+ * param: "fileURL" value="file:///c:/events.log"
* param: "tailing" value="true"
*
* The 'tailing' parameter allows the contents of the file to be continually read and new events processed.
@@ -153,7 +154,7 @@
private SimpleDateFormat dateFormat;
private String timestampFormat = "yyyy-MM-d HH:mm:ss,SSS";
private String logFormat;
- private String fileName;
+ private String fileURL;
private String shortFileName;
private boolean tailing;
private String filterExpression;
@@ -204,7 +205,7 @@
/**
* Test
*
- * @param args file name to parse
+ * @param args file url to parse
*/
public static void main(String[] args) {
LogFilePatternReceiver parser = new LogFilePatternReceiver();
@@ -217,11 +218,12 @@
//System.out.println("Created event: " + parser.convertToEvent("2004-12-13 22:49:22,820 DEBUG SOME VALUE [Thread-0] Generator2 (Generator2.java:100) - <test> <test2>something here</test2> <test3 blah=something/> <test4> <test5>something else</test5> </test4></test>"));
//parser.initialize("THREAD LEVEL LOGGER - MESSAGE");
//parser.setLogFormat("RELATIVETIME PROP(USERID) [THREAD] LEVEL LOGGER * - MESSAGE");
- parser.setFileName(args[0]);
+ parser.setFileURL(args[0]);
parser.initialize();
try {
- parser.process(new FileReader(new File(parser.getFileName())));
+ //expects an unbuffered reader
+ parser.process(new InputStreamReader(new URL(parser.getFileURL()).openStream()));
//parser.process(new StringReader("2004-12-13 22:49:22,820 DEBUG SOME VALUE [Thread-0] Generator2 (Generator2.java:100) - <test> <test2>something here</test2> <test3 blah=something/> <test4> <test5>something else</test5> </test4></test>\nException blah\n\tat someplace.java:555\n\tat nextline blah:55"));
} catch (IOException ioe) {
@@ -234,20 +236,24 @@
/**
* Accessor
*
- * @return file name
+ * @return file URL
*/
- public String getFileName() {
- return fileName;
+ public String getFileURL() {
+ return fileURL;
}
/**
* Mutator
*
- * @param fileName
+ * @param fileURL
*/
- public void setFileName(String fileName) {
- this.fileName = fileName;
- shortFileName = new File(fileName).getName();
+ public void setFileURL(String fileURL) {
+ this.fileURL = fileURL;
+ try {
+ shortFileName = new URL(fileURL).getFile();
+ } catch (MalformedURLException mue) {
+ shortFileName = fileURL;
+ }
}
/**
@@ -683,7 +689,7 @@
initialize();
try {
- process(new FileReader(new File(getFileName())));
+ process(new InputStreamReader(new URL(getFileURL()).openStream()));
} catch (IOException ioe) {
ioe.printStackTrace();
}
1.102 +1 -1 logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
Index: LogUI.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- LogUI.java 23 Jul 2004 06:43:29 -0000 1.101
+++ LogUI.java 26 Jul 2004 07:39:31 -0000 1.102
@@ -727,7 +727,7 @@
((ImageIcon) ChainsawIcons.ICON_PREFERENCES).getImage());
preferencesFrame.getContentPane().add(applicationPreferenceModelPanel);
- preferencesFrame.setSize(640, 480);
+ preferencesFrame.setSize(640, 520);
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
preferencesFrame.setLocation(
1.13 +1 -1 logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
Index: ChainsawStatusBar.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ChainsawStatusBar.java 28 Mar 2004 10:04:30 -0000 1.12
+++ ChainsawStatusBar.java 26 Jul 2004 07:39:31 -0000 1.13
@@ -85,7 +85,7 @@
receivedEventLabel.setMinimumSize(
new Dimension(
receivedEventLabel.getFontMetrics(receivedEventLabel.getFont())
- .stringWidth("999.9/s") + 5,
+ .stringWidth("9999.9/s") + 5,
(int) receivedEventLabel.getPreferredSize().getHeight()));
eventCountLabel.setBorder(statusBarComponentBorder);
1.16 +3 -3 logging-log4j/src/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java
Index: ApplicationPreferenceModelPanel.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ApplicationPreferenceModelPanel.java 17 Jun 2004 00:14:46 -0000 1.15
+++ ApplicationPreferenceModelPanel.java 26 Jul 2004 07:39:31 -0000 1.16
@@ -64,7 +64,7 @@
private JTextField identifierExpression;
private JTextField toolTipDisplayMillis;
private JTextField cyclicBufferSize;
- private final JTextField configurationURL = new JTextField(25);
+ private final JTextField configurationURL = new JTextField(35);
ApplicationPreferenceModelPanel(ApplicationPreferenceModel model) {
this.committedPreferenceModel = model;
@@ -434,7 +434,7 @@
JPanel p6 = new JPanel(new FlowLayout(FlowLayout.LEFT));
- p6.add(new JLabel("Automatic Configuration"));
+ p6.add(new JLabel("Automatic Configuration URL"));
p6.add(Box.createHorizontalStrut(5));
p6.add(configurationURL);
add(p6);
@@ -447,7 +447,7 @@
add(Box.createVerticalGlue());
- configurationURL.setToolTipText("A complete and valid URL identifying the location of a valid log4.xml file to auto-configure Receivers and other Plugins");
+ configurationURL.setToolTipText("A complete and valid URL identifying the location of a valid log4 xml configuration file to auto-configure Receivers and other Plugins");
configurationURL.setInputVerifier(new InputVerifier() {
public boolean verify(JComponent input)
1.9 +1 -1 logging-log4j/src/xdocs/chainsaw.xml
Index: chainsaw.xml
===================================================================
RCS file: /home/cvs/logging-log4j/src/xdocs/chainsaw.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- chainsaw.xml 18 May 2004 03:06:25 -0000 1.8
+++ chainsaw.xml 26 Jul 2004 07:39:31 -0000 1.9
@@ -73,7 +73,7 @@
<li>CVS (<a href="http://www.cygwin.com/">Cygwin</a> is handy for Windows users)</li>
</UL>
<P>Once you have downloaded and placed this script in a directory where you want Chainsaw v2 installed, you can type:</P>
- <pre>ant -f install-chansaw.xml</pre>
+ <pre>ant -f install-chainsaw.xml</pre>
<P>This will download everything you need to build and run Chainsaw v2.</P>
<P>When finally released, we plan to have Chainsaw v2 available via Java WebStart.</P>
</section>
1.34 +9 -0 logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html
Index: release-notes.html
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- release-notes.html 24 Jul 2004 07:20:35 -0000 1.33
+++ release-notes.html 26 Jul 2004 07:39:32 -0000 1.34
@@ -9,6 +9,15 @@
<h1>1.99.99</h2>
+<h2>25 July 2004</h2>
+<ul>
+<li>Updated LogFilePatternReceiver to rely on a URL for the file location instead of a file name (<b>fileName</b> param replaced with <b>fileURL</b>)</li>
+<li>Added editor support for primitive boolean properties in PluginPropertyEditorPanel (setting the 'tailing' parameter to 'true' on a LogFilePatternReceiver from inside Chainsaw now works)</li>
+<li>Updated width and label of 'automatic configuration' app preference to explicitly show it is a URL</li>
+<li>Updated height of app preferences frame to show all fields completely</li>
+<li>Widened data rate field in status bar</li>
+</ul>
+
<h2>24 July 2004</h2>
<ul>
<li>Added scroll to bottom menu item, toolbar and ctrl-b accelerator.</li>
1.5 +3 -0 logging-log4j/src/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
Index: PluginPropertyEditorPanel.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PluginPropertyEditorPanel.java 27 Feb 2004 16:47:31 -0000 1.4
+++ PluginPropertyEditorPanel.java 26 Jul 2004 07:39:32 -0000 1.5
@@ -196,6 +196,8 @@
TableCellEditorFactory.createBooleanTableCellEditor());
editorMap.put(Level.class,
TableCellEditorFactory.createLevelTableCellEditor());
+ //support primitive boolean parameters with the appropriate editor
+ editorMap.put(boolean.class, TableCellEditorFactory.createBooleanTableCellEditor());
}
/* (non-Javadoc)
@@ -207,6 +209,7 @@
PluginPropertyTableModel model = (PluginPropertyTableModel) table.getModel();
PropertyDescriptor descriptor = model.getDescriptors()[row];
Class valueClass = descriptor.getPropertyType();
+
if (editorMap.containsKey(valueClass)) {
DefaultCellEditor editor =
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org