Skip to content

Commit

Permalink
日志文件滚动命名不应当包含日志
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyl committed Jul 2, 2019
1 parent 9557bdb commit 4e54f4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Handler/NamedRotatingFileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ protected function rotate()

// matching all log files
$fileInfo = pathinfo($this->url);
$date = date($this->dateFormat);
$baseFile = "{$this->url}.$date.";
$logFiles = glob("{$this->url}.$date.*");
$baseFile = "{$this->url}.";
$logFiles = glob("{$this->url}.*");

// sorting the files by name to remove or rename the older ones
usort($logFiles, function ($a, $b) {
Expand Down

0 comments on commit 4e54f4a

Please sign in to comment.