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 yo...@apache.org on 2005/07/28 20:32:18 UTC
cvs commit: logging-log4j/src/java/org/apache/log4j/xml/examples XMLSample.java package.html
yoavs 2005/07/28 11:32:18
Modified: . build.xml
docs HISTORY.txt
src/java/org/apache/log4j/xml DOMConfigurator.java
XMLLayout.java
src/java/org/apache/log4j/xml/examples XMLSample.java
package.html
Log:
Bugzilla 14551: http://issues.apache.org/bugzilla/show_bug.cgi?id=14551
Revision Changes Path
1.165 +12 -2 logging-log4j/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/logging-log4j/build.xml,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -r1.164 -r1.165
--- build.xml 24 Jul 2005 16:07:15 -0000 1.164
+++ build.xml 28 Jul 2005 18:32:18 -0000 1.165
@@ -218,8 +218,8 @@
Missing java.mail.* classes.
- Please make sure to that the "jms.jar" property in build.properties
- file is set correctly.
+ Please make sure that the "javamail.jar" and "activation.jar"
+ properties in the build.properties file are set correctly.
</fail>
@@ -752,6 +752,16 @@
<classpath refid="compile.classpath"/>
<classpath path="${regexp.oro.jar}"/>
</javadoc>
+
+ <!-- Extra files referenced by JavaDocs -->
+ <copy file="${java.source.dir}/org/apache/log4j/xml/log4j.dtd"
+ tofile="${javadoc.dest}/org/apache/log4j/xml/log4j.dtd" />
+ <copy todir="${javadoc.dest}/org/apache/log4j/xml/examples">
+ <fileset dir="${java.source.dir}/org/apache/log4j/xml/examples">
+ <include name="sample*.xml" />
+ <include name="XMLSample.java" />
+ </fileset>
+ </copy>
</target>
1.30 +3 -0 logging-log4j/docs/HISTORY.txt
Index: HISTORY.txt
===================================================================
RCS file: /home/cvs/logging-log4j/docs/HISTORY.txt,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- HISTORY.txt 27 Jul 2005 04:53:25 -0000 1.29
+++ HISTORY.txt 28 Jul 2005 18:32:18 -0000 1.30
@@ -39,6 +39,9 @@
cause PropertyConfigurator to *temporarily* output logs generated
during the configuration process. This is very similar to the way the
debug attribute works in configuration files in XML format. [*]
+
+ - Fixed Bugzilla 14551, misplaces sample.xml links in JavaDocs.
+ http://issues.apache.org/bugzilla/show_bug.cgi?id=14551 [*]
January 20th, 2005
1.74 +2 -2 logging-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java
Index: DOMConfigurator.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- DOMConfigurator.java 7 Mar 2005 05:35:18 -0000 1.73
+++ DOMConfigurator.java 28 Jul 2005 18:32:18 -0000 1.74
@@ -1,5 +1,5 @@
/*
- * Copyright 1999,2005 The Apache Software Foundation.
+ * Copyright 1999,2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@
Use this class to initialize the log4j environment using a DOM tree.
<p>The DTD is specified in <a
- href="doc-files/log4j.dtd"><b>log4j.dtd</b></a>.
+ href="log4j.dtd"><b>log4j.dtd</b></a>.
<p>Sometimes it is useful to see how log4j is reading configuration
files. You can enable log4j internal logging by defining the
1.32 +5 -4 logging-log4j/src/java/org/apache/log4j/xml/XMLLayout.java
Index: XMLLayout.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/XMLLayout.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- XMLLayout.java 21 Jul 2005 22:08:11 -0000 1.31
+++ XMLLayout.java 28 Jul 2005 18:32:18 -0000 1.32
@@ -1,5 +1,5 @@
/*
- * Copyright 1999,2004 The Apache Software Foundation.
+ * Copyright 1999,2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-// Contributors: Mathias Bogaert
package org.apache.log4j.xml;
import org.apache.log4j.Layout;
@@ -29,7 +28,7 @@
/**
* The output of the XMLLayout consists of a series of log4j:event elements as
- * defined in the <a href="doc-files/log4j.dtd">log4j.dtd </a>. It does not
+ * defined in the <a href="log4j.dtd">log4j.dtd </a>. It does not
* output a complete well-formed XML file. The output is designed to be included
* as an <em>external entity</em> in a separate file to form a correct XML
* file.
@@ -59,6 +58,8 @@
* output generated by XMLLayout. The value of this attribute should be "1.1"
* for output generated by log4j versions prior to log4j 1.2 (final release) and
* "1.2" for relase 1.2 and later.
+ *
+ * Contributors: Mathias Bogaert
*
* @author Ceki Gülcü
* @since 0.9.0
@@ -215,4 +216,4 @@
output.write("</log4j:event>\r\n\r\n");
}
-}
\ No newline at end of file
+}
1.9 +75 -50 logging-log4j/src/java/org/apache/log4j/xml/examples/XMLSample.java
Index: XMLSample.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/examples/XMLSample.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLSample.java 18 Nov 2004 09:49:59 -0000 1.8
+++ XMLSample.java 28 Jul 2005 18:32:18 -0000 1.9
@@ -1,3 +1,19 @@
+/*
+ * Copyright 1999,2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.log4j.xml.examples;
@@ -6,57 +22,66 @@
import org.apache.log4j.Logger;
/**
-
- This <a href="doc-files/XMLSample.java">example code</a> shows how to
- read an XML based configuration file using a DOM parser.
-
- <p>Sample XML files <a href="doc-files/sample1.xml">sample1.xml</a>
- and <a href="doc-files/sample2.xml">sample2.xml</a> are provided.
-
-
- <p>Note that the log4j.dtd is not in the local directory.
- It is found by the class loader.
-
- @author Ceki Gülcü
-
-*/
+ *
+ * This <a href="XMLSample.java">example code</a> shows how to
+ * read an XML based configuration file using a DOM parser.
+ *
+ * <p>Sample XML files <a href="sample1.xml">sample1.xml</a>
+ * and <a href="sample2.xml">sample2.xml</a> are provided.
+ *
+ * <p>Note that the log4j.dtd is not in the local directory.
+ * It is found by the class loader.
+ *
+ * @author Ceki Gülcü
+ *
+ */
public class XMLSample {
- static Logger cat = Logger.getLogger(XMLSample.class.getName());
+ static Logger cat = Logger.getLogger(XMLSample.class.getName());
- public
- static
- void main(String argv[]) {
-
- if(argv.length == 1)
- init(argv[0]);
- else
- Usage("Wrong number of arguments.");
- sample();
- }
-
- static
- void Usage(String msg) {
- System.err.println(msg);
- System.err.println( "Usage: java " + XMLSample.class.getName() +
- "configFile");
- System.exit(1);
- }
-
- static
- void init(String configFile) {
- JoranConfigurator jc = new JoranConfigurator();
- jc.doConfigure(configFile, LogManager.getLoggerRepository());
- }
-
- static
- void sample() {
- int i = -1;
- Logger root = Logger.getRootLogger();
- cat.debug("Message " + ++i);
- cat.warn ("Message " + ++i);
- cat.error("Message " + ++i);
- Exception e = new Exception("Just testing");
- cat.debug("Message " + ++i, e);
- }
+ /**
+ * Command-line entry.
+ */
+ public static void main(String argv[]) {
+ if(argv.length == 1) {
+ init(argv[0]);
+ } else {
+ Usage("Wrong number of arguments.");
+ }
+
+ sample();
+ }
+
+ /**
+ * Usage printout.
+ */
+ static void Usage(String msg) {
+ System.err.println(msg);
+ System.err.println( "Usage: java " + XMLSample.class.getName() +
+ "configFile");
+ System.exit(1);
+ }
+
+ /**
+ * Init the class.
+ */
+ static void init(String configFile) {
+ JoranConfigurator jc = new JoranConfigurator();
+ jc.doConfigure(configFile, LogManager.getLoggerRepository());
+ }
+
+ /**
+ * Run the sample.
+ */
+ static void sample() {
+ int i = -1;
+
+ Logger root = Logger.getRootLogger();
+ cat.debug("Message " + ++i);
+ cat.warn ("Message " + ++i);
+ cat.error("Message " + ++i);
+
+ Exception e = new Exception("Just testing");
+ cat.debug("Message " + ++i, e);
+ }
}
1.4 +6 -6 logging-log4j/src/java/org/apache/log4j/xml/examples/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/examples/package.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- package.html 27 Jun 2001 21:34:39 -0000 1.3
+++ package.html 28 Jul 2005 18:32:18 -0000 1.4
@@ -10,13 +10,13 @@
configuration file.
<p>See source code of <a
-href="../doc-files/XMLSample.java">XMLSample.java</a> showing how to
+href="XMLSample.java">XMLSample.java</a> showing how to
configure with an XML file. Sample XML files
-<a href="../doc-files/sample1.xml">sample1.xml</a>,
-<a href="../doc-files/sample2.xml">sample2.xml</a>,
-<a href="../doc-files/sample3.xml">sample3.xml</a>,
-<a href="../doc-files/sample4.xml">sample4.xml</a>,
-<a href="../doc-files/sample5.xml">sample5.xml</a> are provided.
+<a href="sample1.xml">sample1.xml</a>,
+<a href="sample2.xml">sample2.xml</a>,
+<a href="sample3.xml">sample3.xml</a>,
+<a href="sample4.xml">sample4.xml</a>,
+<a href="sample5.xml">sample5.xml</a> are provided.
<hr>
<address></address>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org