ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tuft Muller" <>
Subject RE: Log4j xml config evaluation
Date Tue, 11 Dec 2001 12:49:18 GMT
| > I guess one way to do it is to configure a new Java process with the
| > DOMConfigurator/logfj.xml and check if any errors are submitted to std
| err.
| Does the DOMConfigurator throw exceptions?

Unfortunately not (except javax.xml.parsers.FactoryConfigurationError, which
is a subclass of java.lang.Error).

|  If so, you could just wrap it
| inside a JUnit test case and use the <junit> task to deal with it
| (haltonfailure="true" even!).  Even without exceptions, if there is
| something you can check for perhaps a JUnit test is still a good
| thing.  Or
| a custom Ant task (which should live in the Log4j codebase, I'd
| think) would
| be even more easily re-usable by others.

I agree. An ant task is definately the way to go, but my time is very
limited at the mo, and I'm already familiar with JUnit, so I think that's
the best tip for now.

BTW, it seems like xmlvalidator always look for the dtd in the directory
where it finds the XML file. What if I use a FileSet? Can I point to a
common dtd for all the files?

The log4j XML files start with:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

I'm by no means an XML expert, but doesn't the second statement indicate
that log4j.dtd should be searched for in the CLASSPATH?



Copyright ERA Technology Ltd. 2001. ( All rights reserved. 
Confidential. No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message