logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: calling DOMConfigurator.configureAndWatch() 2 times
Date Wed, 13 Aug 2003 13:17:52 GMT


>What should happen if the configureAndWatch() function is called twice?
>Are the previous settings erased? Are they accumulated ?

It wouldn't be that hard to simply test this and see what happens ;)

But looking at the code, you see:

- configureAndWatch always creates a new XMLWatchdog, so you will have
two XMLWatchdogs watching over the file.  

- Each XMLWatchdog would call DOMConfigurator#doConfigure(filename,
repository) when the file changes, so this method will get called twice.
So this is extra overhead that should be avoided if possible.

- The configuration file will get parsed again with a new parser

- Parsing will replace where found and add where not found.  So if
there's already a logger for class, for example, it will be retrieved if
it exists and reconfigured, or a new one will be created if one doesn't

You can walk through the rest of DOMConfigurator if you feel like it ;)
This is one issue where the test is easy so I wouldn't even spend time
looking at the code ;)

Yoav Shapira

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message