Skip to content

Commit

Permalink
改进日志备份文件名规则
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Sep 4, 2024
1 parent d693769 commit 18cffea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/think/log/driver/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ protected function checkLogSize(string $destination): void
{
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
try {
rename($destination, dirname($destination) . DIRECTORY_SEPARATOR . time() . '-' . basename($destination));
rename($destination, dirname($destination) . DIRECTORY_SEPARATOR . basename($destination, '.log') . '-' . time() . '.log');
} catch (\Exception $e) {
//
}
Expand Down

0 comments on commit 18cffea

Please sign in to comment.