ceki 01/10/04 14:07:04 Modified: src/java/org/apache/log4j/test runAll src/java/org/apache/log4j/xml DOMConfigurator.java Makefile log4j.dtd Added: src/java/org/apache/log4j/xml SAXErrorHandler.java Log: - Improved error reporting in xml/DOMConfigurator.java - fixed compatibility issue in log4j.dtd Revision Changes Path 1.12 +1 -0 jakarta-log4j/src/java/org/apache/log4j/test/runAll Index: runAll =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/test/runAll,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- runAll 2001/09/28 13:37:48 1.11 +++ runAll 2001/10/04 21:07:04 1.12 @@ -11,6 +11,7 @@ ./defaultInit || die "defaultInit test FAILED." ./propConfig || die "propConfig test FAILED." ./getOptions || die "getOptions test FAILED." +./domTest || die "domTest FAILED." ./thresholdFlagTest || die "enableFlagTest test FAILED." ./multipleAppenders || die "multipleAppenders test FAILED." ./confParsing || die "confParsing test FAILED." 1.38 +1 -1 jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java Index: DOMConfigurator.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- DOMConfigurator.java 2001/09/28 13:37:48 1.37 +++ DOMConfigurator.java 2001/10/04 21:07:04 1.38 @@ -634,7 +634,7 @@ //dbf.setNamespaceAware(true); DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - //docBuilder.setErrorHandler(new ReportParserError()); + docBuilder.setErrorHandler(new SAXErrorHandler()); Class clazz = this.getClass(); URL dtdURL = clazz.getResource("/org/apache/log4j/xml/log4j.dtd"); 1.5 +1 -1 jakarta-log4j/src/java/org/apache/log4j/xml/Makefile Index: Makefile =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile 2001/09/04 18:44:48 1.4 +++ Makefile 2001/10/04 21:07:04 1.5 @@ -3,7 +3,7 @@ DEPTH :=../../../../../.. JSOURCES:=DOMConfigurator.java\ XMLLayout.java\ - + SAXErrorHandler.java\ SUBDIRS := examples test 1.12 +6 -15 jakarta-log4j/src/java/org/apache/log4j/xml/log4j.dtd Index: log4j.dtd =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/log4j.dtd,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- log4j.dtd 2001/09/28 13:37:49 1.11 +++ log4j.dtd 2001/10/04 21:07:04 1.12 @@ -9,30 +9,21 @@ <!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, categoryFactory?)> -<!-- The disable attribute takes a priority value such that all --> -<!-- logging statements with a prioroty equal or below this value are --> +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> <!-- disabled. --> -<!-- The disableOverride attribute allows the user to override any --> -<!-- BasicConfigurator.disable invocations made from within the --> -<!-- application. --> - -<!-- By default, disableOverride is "null", meaning that we --> -<!-- do not touch the disable flag. --> - <!-- Setting the "debug" or "configDebug" attributes enable the printing --> <!-- of internal log4j logging statements. --> -<!-- The "debug" and "configDebug" attributes are equivalent altough --> -<!-- the latter is deprecated and should no longer be used. --> -<!-- By default, debug and configDebug attributes are "null", meaning --> -<!-- that we not touch internal log4j logging settings. --> + +<!-- By default, debug attribute is "null", meaning that we not touch --> +<!-- internal log4j logging settings. --> <!ATTLIST log4j:configuration xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" threshold (all|debug|info|warn|error|fatal|off|null) "null" debug (true|false|null) "null" - configDebug (true|false|null) "null" > <!-- renderer elements allow the user to customize the conversion of --> @@ -125,7 +116,7 @@ <!-- If no priority element is specified, then the configurator MUST not --> <!-- touch the priority of root. --> <!-- The root category always exists and cannot be subclassed. --> -<!ELEMENT root (param*, level?, appender-ref*)> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> <!-- ==================================================================== --> 1.1 jakarta-log4j/src/java/org/apache/log4j/xml/SAXErrorHandler.java Index: SAXErrorHandler.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software * License version 1.1, a copy of which has been included with this * distribution in the LICENSE.txt file. */ package org.apache.log4j.xml; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXParseException; import org.apache.log4j.helpers.LogLog; public class SAXErrorHandler implements ErrorHandler { public void error(SAXParseException ex) { LogLog.error("Parsing error on line "+ex.getLineNumber()+" and column " +ex.getColumnNumber()); LogLog.error(ex.getMessage(), ex.getException()); } public void fatalError(SAXParseException ex) { error(ex); } public void warning(SAXParseException ex) { LogLog.warn("Parsing error on line "+ex.getLineNumber()+" and column " +ex.getColumnNumber()); LogLog.warn(ex.getMessage(), ex.getException()); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]