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!

Replies are listed 'Best First'.
Re^3: Log4perl log rotation in threadpool environment
by space_monk (Chaplain) on Nov 17, 2012 at 17:51 UTC
    Another satisfied customer :-)
    A Monk aims to give answers to those who have none, and to learn from those who know more.