Created attachment 29137 [details] patch had troubles configuring the FileHandler while bootstraping Tomcat, this patch sums up a few (minor) changes that allows one to setup a FileHandler instance programatically. the changes are the following : - delay opening a file until something gets logged (since the code is already there within publish() to support rolling it kind of made sense to open the file from publish() instead of the constructor) - add a constructor where all 'configurable' properties of the handler can be provided programatically - since FileHandler.close() is public API so should be open() I'm very sorry to have no tests, I've happened to test the desired FileHandler "behavior" with https://github.com/trinidad/trinidad and is currently contained within the 1.4.0 release of Trinidad.
Apologies for the delay in getting to this. Making open() public is likely to break any custom sub-classes. It seems likely that such classes might exist so I intend to skip that part of the patch. I've applied the constructor changes to 9.0.x for 9.0.14 onwards. The changes to delay opening the file break sub-classes so those need to wait until 10.x. I'll attach a patch with these specific changes.
Created attachment 36265 [details] Delayed file opening changes
It took a little longer but Tomcat 10 is now under development so I have applied these changes. Fixed in: - master for 10.0.0.0-M1 onwards