I'm using -Dlog4j.configuration=somefile.xml, I'm not configuring Joran 
programmatically, so I can't call joranConfiguratorInstance.getErrorList.  I'd 
expect these errors to end up on the console like other config diagnostic info 
if you're doing an auto-config.

Log4J HEAD
jdk1.4.2_05
WinXP
built-in XML libraries

Specifically, I've got an xml config file I'm using to configure Chainsaw.  

Removing these lines from the top of my config file allows Joran to proceed 
successfully:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> 

With these lines included, the XMLUtil class reports ILL_FORMED and adds the 
error to the error list, but this error list is never dumped to the terminal at 
this point.  

The result is that my config is never parsed, and no output is generated - as 
if I never had specified a configuration file.

Let me know if you need more info.

Scott


-----Original Message-----
From:   Ceki Gülcü [mailto:[EMAIL PROTECTED]
Sent:   Mon 11/29/2004 9:58 AM
To:     Log4J Developers List
Cc:     
Subject:        Re: Joran not reporting config errors
At 06:24 PM 11/29/2004, Scott Deboy wrote:
>I've been getting a SAXParseException (once I knew where to get the stack 
>trace) using Joran with an existing log4j config file, but the error 
>wasn't being propagated.

The error is available through joranConfigratorInstance.getErrorList().

>I can't see how the ExecutionContext is propagating the error list.

As just mentioned, it is available in joranConfigratorInstance.getErrorList().

>It doesn't look like anything calls ConfiguratorBase.dumpErrors or 
>anything that could report startup config failure is getting the error 
>list from the ExecutionContext.

The user has to call joranConfigratorInstance.getErrorList() on her own. Do 
you have a better idea?

>By the way, for those with existing log4j xml config files, the system may 
>act as if it couldn't find your config.

That should not be the case. log4j.dtd is not required but its existence 
should not cause an error. Instead you should get a warning message with a 
reference to

http://logging.apache.org/log4j/docs/codes.html#log4j_dtd

>  Here's the reason:
>
>org.xml.sax.SAXParseException: Relative URI "log4j.dtd"; can not be 
>resolved without a base URI.
>
>I have the -Dlog4j.debug=true in my script.

Joran ignores -Dlog4j.debug=true. I think -Dlog4j.debug should be deprecated...

>I thought I saw something on the list about having to change existing 
>config files with 1.3 alpha.  I'll go through the archives and see if 
>something pops up, but if someone knows how to fix this (Ceki?) I'd 
>appreciate hearing how.

The SAXParseException you are observing should not occur yet it does. :-) 
I'd be interested in the stack trace and more info on your set up. JVM, 
log4j version, XML parser...

>Thanks
>Scott

-- 
Ceki Gülcü

  The complete log4j manual:  http://qos.ch/eclm
  Professional log4j support: http://qos.ch/log4jSupport  



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




<<winmail.dat>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to