Default configuration process does not close input stream which is used to read "log4j.properties". It causes impossibility to redeploy web application under windows - the old one cannot be removed as it contains an opened file. I attach the test case with the patch inside.
Created attachment 19108 [details] test case with a patch inside the test case contains 2 tests - the first, test_Log4jCloseConfigStream, does not pass, it shows the described bug, - the second, test_PatchedLog4jCloseConfigStream, shows that the offered fix works Additionally PatchedPropertyConfigurator contains minor fixes for PropertyConfigurator.doConfigure(String configFileName, LoggerRepository hierarchy), which closes the input stream not very correct
I can confirm this bug for 1.2.14. It should be solved before 1.2.15 comes out. Added as 'depends on' to #40951.
Committed against 1.2 branch in rev 510831 and rev 510836 for 1.3. Neither branch caught IllegalArgumentException which is thrown if file contains a bad unicode escape sequence. 1.3 attempted to close URL stream under normal circumstances.
*** Bug 41409 has been marked as a duplicate of this bug. ***
Only comment on this is that the comments in the tests refer to 19108 and not 40944. 10198 is a commons-logging bug from many years back.
Test comments corrected in rev 529304
*** Bug 42148 has been marked as a duplicate of this bug. ***
Can you please consider a 1.2.15 release because of this bug? When I use 1.2.14 in tomcat, I cannot reliably undeploy a webapp because log4j will not unlock log4j.properties.
I believe 1.2.15RC2 is available for testing purposes: http://people.apache.org/builds/logging/log4j/1.2.15/ Be great if you could confirm that rc2 release resolves this issue. We're probably not too far away from a vote to release 1.2.15; how that vote goes I can't say.
The current Release Candidate for 1.2.15 solves my problem. So a final release would be nice.