Create new log files after rotation.

This commit is contained in:
Retro_Guy 2024-11-21 04:17:16 -07:00
parent 3d3b3a96e9
commit 3febc1935c
1 changed files with 1 additions and 0 deletions

View File

@ -318,6 +318,7 @@ function log_rotate()
@rename($logfile . '.1', $logfile . '.2'); @rename($logfile . '.1', $logfile . '.2');
file_put_contents($logfile, "\nLog file rotated", FILE_APPEND); file_put_contents($logfile, "\nLog file rotated", FILE_APPEND);
@rename($logfile, $logfile . '.1'); @rename($logfile, $logfile . '.1');
file_put_contents($logfile, "\nLog file started", FILE_APPEND);
echo 'Rotated: ' . $logfile . "\n"; echo 'Rotated: ' . $logfile . "\n";
} }
unlink($logdir . '/rotate'); unlink($logdir . '/rotate');