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
Thanks again!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 $!";
|
---|
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 |
In Section
Seekers of Perl Wisdom