Skip to content

Commit

Permalink
filenameFormat support customization
Browse files Browse the repository at this point in the history
  • Loading branch information
liutaot committed Jun 21, 2023
1 parent ccbd7db commit aaa7cb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Monolog/Handler/RotatingFileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class RotatingFileHandler extends StreamHandler
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param bool $useLocking Try to lock log file before doing any writes
*/
public function __construct(string $filename, int $maxFiles = 0, int|string|Level $level = Level::Debug, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false, string $dateFormat = self::FILE_PER_DAY)
public function __construct(string $filename, int $maxFiles = 0, int|string|Level $level = Level::Debug, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false, string $dateFormat = self::FILE_PER_DAY, string $filenameFormat = '{filename}-{date}')
{
$this->filename = Utils::canonicalizePath($filename);
$this->maxFiles = $maxFiles;
$this->filenameFormat = '{filename}-{date}';
$this->filenameFormat = $filenameFormat;
$this->setDateFormat($dateFormat);
$this->nextRotation = $this->getNextRotation();

Expand Down

0 comments on commit aaa7cb4

Please sign in to comment.