Hi,
I have a program that writes a logfile, and each night rotates those
logfiles using Logfile::Rotate. I tried the function the first time this
nicht, and found the service dying, because it couldn't lock the logfile.
The code for rotation is this one:
if ($today!=$day) {
my $log = new Logfile::Rotate( File =>
'$path/btetransfer_output.log',
Count => 30,
Gzip => 'lib',
Flock => 'yes',
Persist => 'no',
);
$log->rotate();
undef $log;
}
Logfile::Rotate tries to open and lock the file for rotation. I guess, it
died because I had the file open for logging reasons (it is open all the
time actually).
Now I'm not sure, how to handle the closing of the file. I could do a "close
LOG" before the "new Logfile::Rotate", but do I have to do my complete open
open (LOG, ">>$path/btetransfer_output.log") or die "Can't open Logfile!\n";
LOG->autoflush(1);
after that again?
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs