http://www.perlmonks.org?node_id=1004229


in reply to Re: Log4perl log rotation in threadpool environment
in thread Log4perl log rotation in threadpool environment

Thanks! That was my original idea actually but wasnt aware I could erase (truncate was apparently the word I should have search on) the contents of the file with file handle open. Changed my obnoxious swapping code to
copy($currFile, $logDir. $self->{old_logs_name}. '.1') or die +"Could not copy the log file because $!"; my $fh = $self->{fh}; truncate($fh, 0) or die "Could not truncate the log file becau +se $!"; seek($fh, 0, 0) or die "Could not set the position in the log +file because $!";
Thanks again!