Whenever log4j2's RollingFileAppender rotates a log file on my web server (when the first entry is written on a new day) the available disk space shrinks considerably.
I use log4j-1.2.17.jar.
lsof shows deleted files, which can't be freed because they are in use by my java process.
For instance, the file FOP.log was rotated to FOP.log.2016-04-13.gz which apparently worked well, but now
[crauser@localhost logs]$ lsof | grep "/" | grep deleted
java 3204 crauser 1w REG 253,0 10486278 1054558 /home/crauser/cra.decap/decap.interface/logs/cra_decap_consumer.log.5 (deleted)
java 3204 crauser 2w REG 253,0 10486278 1054558 /home/crauser/cra.decap/decap.interface/logs/cra_decap_consumer.log.5 (deleted)
shows 270 times the file FOP.log.2016-04-13 (without the gz suffix).
These undeleted files eat up several GB of disk space.
These files are gone as soon as I kill java process, but restarting by killing process is not an option.
Is there a way to prevent this file handle leak?