At 05:19 PM 1/21/2004 -0500, you wrote:
Included is a patch for log4j 1.2.8. The patch is for two things.

1) log4j 1.2.8 PropertyConfigurator & DOMConfigurator both have a small bug in the void doConfigure(URL url, LoggerRepository repository) methods. They open a stream on the URL, but do not close it. This means the file cannot be edited while the application is running because log4j has it locked. This is easy to fix by closing the stream when log4j has finished reading it.

Thanks. Your fix was incorporated yesterday into CVS head.


2) Added a new method to LogManager called refreshConfiguration(). This method will call a newly modified Hierarchy.resetConfiguration. The old signature was resetConfiguration() and the new one is
resetConfiguration(boolean warnNoEmit). If the parameter is true, log4j will emit a "Please initialize the log4j system properly." message if any thread attempts to log before the configuration is reloaded. If false, the message will never be output. The LogManager.refreshConfiguration() will then re-load the configuration file that was used when the app first started.


Log messages that occur between the reset and reload are lost. If the new configuration file fails, log4j will output a message to stdout, and no logging will take place until the error in the file is corrected and LogManager.refreshConfiguration() is called again. If the file is ok at that point, logging will resume using the the settings in the new configuration.

Let me know if this patch gets accepted, or other modifications to it are needed.

There are a number of architectural enhancements to log4j which can be used to add functionality you desire, e.g. plug-ins and JoranConfigrator. As this juncture in time, it seems undesirable to overload the existing Hierarchy interface with new methods.


Thank you for your understanding.


-- Ceki G�lc�

For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp




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



Reply via email to