1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2020-05-21 16:59:46 +02:00
6 changed files with 82 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ namespace Monolog\Handler;
use InvalidArgumentException;
use Monolog\Logger;
use Monolog\Utils;
/**
* Stores logs to files that are rotated every day and a limited number of files are kept.
@@ -46,7 +47,7 @@ class RotatingFileHandler extends StreamHandler
*/
public function __construct(string $filename, int $maxFiles = 0, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false)
{
$this->filename = $filename;
$this->filename = Utils::canonicalizePath($filename);
$this->maxFiles = $maxFiles;
$this->nextRotation = new \DateTimeImmutable('tomorrow');
$this->filenameFormat = '{filename}-{date}';