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 <[EMAIL PROTECTED]> wrote:
> On 1/18/07, Marcel Gołuński <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/