logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stauffer" <stauffer.ja...@gmail.com>
Subject Re: Confirm successful reading of a conf file, check if loggers and appenders were instatntiated
Date Thu, 18 Jan 2007 17:06:27 GMT
Could the configure method be changed to return a boolean indicating
sucess?  If someone detected that configuration failed, would log4j be
in an undefined state so that configuring with another file might not
produce the desired results?

One way to detect config problems would be to run with -Dlog4j.debug
and capture and parse System.out info produced by log4j.

On 1/18/07, Curt Arnold <carnold@apache.org> wrote:
> > On 1/18/07, Marcel Gołuński <mgolunski@gmail.com> wrote:
> >>
> >> Is there any other way (easier, faster) to determine that loggers and
> >> appenders were created and attached succesfully?
> >> Its a pity that log4j does not support exceptions, but i
> >> understand the
> >> "performance issue", and think that it is connected with the lack of
> >> exceptions.
> On Jan 18, 2007, at 9:39 AM, James Stauffer wrote:
> > I believe the reason that log4j configuration doesn't thow exceptions
> > is that normally logging isn't the core reason for the program and a
> > problem with logging shouldn't stop the program.
> >
> > If you look through the API I believe you will find methods to obtain
> > attached appenders so you could verify that way (but then your code
> > would have to know about your config).
> >
> My understanding is the lack of exceptions from the configurators was
> not motivated by performance concerns, but that a bad configuration
> file would not cause an otherwise working application to fail.
> Unfortunately, that design decision makes it difficult to
> programatically respond to configuration failures, like providing a
> backup configuration if the configuration file was missing.
> I did start an experimental project (search for strictxml) in the
> sandbox for new XML configurator that used a stricter syntax and
> provided more feedback on the processing of the configuration.
> However, that has been dormant for a while and probably will not see
> much addition effort until log4j 2.0 development starts whenever that
> is.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
View raw message