1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 19:00:20 +02:00

Merge pull request #1303 from jstaerk/patch-1

support two digit years
This commit is contained in:
Jordi Boggiano
2019-07-06 12:57:14 +02:00
committed by GitHub

View File

@@ -81,7 +81,7 @@ class RotatingFileHandler extends StreamHandler
public function setFilenameFormat(string $filenameFormat, string $dateFormat): self
{
if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) {
if (!preg_match('{^[Yy](([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) {
throw new InvalidArgumentException(
'Invalid date format - format must be one of '.
'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '.