mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Merge branch '1.x', fixes #771
This commit is contained in:
@@ -69,7 +69,7 @@ class RotatingFileHandler extends StreamHandler
|
||||
|
||||
public function setFilenameFormat($filenameFormat, $dateFormat)
|
||||
{
|
||||
if (!preg_match('{^Y(([/_.-]m)([/_.-]d)?)?$}', $dateFormat)) {
|
||||
if (!preg_match('{^Y(([/_.-]?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")'.
|
||||
|
@@ -156,9 +156,13 @@ class RotatingFileHandlerTest extends TestCase
|
||||
['Y/m/d', true],
|
||||
['Y.m.d', true],
|
||||
['Y_m_d', true],
|
||||
['Ymd', true],
|
||||
['Ym/d', true],
|
||||
['Y/m', true],
|
||||
['Ym', true],
|
||||
['Y.m', true],
|
||||
['Y_m', true],
|
||||
['Y/md', true],
|
||||
['', false],
|
||||
['m-d-Y', false],
|
||||
['Y-m-d-h-i', false],
|
||||
|
Reference in New Issue
Block a user