You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Charles Tuckey <ct...@gmail.com> on 2005/09/15 02:15:43 UTC
DOMConfigurator configure methods do not report failure
Hi,
We have a standalone application where the user will be responsible for
modifying the log4j XML logging properties file as they require and/or wish.
So, this means that it is likely they will create invalid XML at some point.
My problem is that the DOMConfigurator configure methods catch all
exceptions and do not report errors programmatically, either through
throwing exceptions or by return value. Instead they write messages to
System.out and System.err. I realize I can prevent these messages from
appearing by setting 'quiet mode' to false.
However, what I really want to do in my code is detect when an error
occurred in the parsing of the XML file and take appropriate action. This
might be informing the user somehow, or by reading in a default XML
properties file or both.
I have looked through the mailing lists and the Bug database and can't find
any discussion on this beyond one email in 2001 that was not replied to. Has
this been an issue for anyone else? Has any thought been given to changing
the action of the configure methods?
--
charlie
Re: DOMConfigurator configure methods do not report failure
Posted by Curt Arnold <ca...@apache.org>.
On Sep 14, 2005, at 7:15 PM, Charles Tuckey wrote:
> Hi,
>
> We have a standalone application where the user will be responsible
> for
> modifying the log4j XML logging properties file as they require and/
> or wish.
> So, this means that it is likely they will create invalid XML at
> some point.
> My problem is that the DOMConfigurator configure methods catch all
> exceptions and do not report errors programmatically, either through
> throwing exceptions or by return value. Instead they write messages to
> System.out and System.err. I realize I can prevent these messages from
> appearing by setting 'quiet mode' to false.
>
> However, what I really want to do in my code is detect when an error
> occurred in the parsing of the XML file and take appropriate
> action. This
> might be informing the user somehow, or by reading in a default XML
> properties file or both.
>
> I have looked through the mailing lists and the Bug database and
> can't find
> any discussion on this beyond one email in 2001 that was not
> replied to. Has
> this been an issue for anyone else? Has any thought been given to
> changing
> the action of the configure methods?
It is an action item for me in my review of the Joran API in
preparation for log4j 1.3.
There was some discussion in the thread "Joran not reporting config
errors" in December 2004. For example http://marc.theaimsgroup.com/?
l=log4j-dev&m=110202005517575&w=2 discussion failure scenarios that
are difficult to recognize with the current API. I added http://
issues.apache.org/bugzilla/show_bug.cgi?id=36675 for the problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org