1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 05:36:45 +02:00

Allow alternative date separators for RotatingFileHandler

Currently only dashes are allowed in date formats (i.e., "Y-m-d").
This commit also allows slashes, underscores and dots to be used instead
of only dashes for more flexibility.
This commit is contained in:
Remon van de Kamp
2016-07-14 21:01:35 +02:00
parent f16e67d523
commit 49d64e1dd5
2 changed files with 16 additions and 3 deletions

View File

@@ -153,8 +153,20 @@ class RotatingFileHandlerTest extends TestCase
[RotatingFileHandler::FILE_PER_DAY, true],
[RotatingFileHandler::FILE_PER_MONTH, true],
[RotatingFileHandler::FILE_PER_YEAR, true],
['Y/m/d', true],
['Y.m.d', true],
['Y_m_d', true],
['Y/m', true],
['Y.m', true],
['Y_m', true],
['', false],
['m-d-Y', false],
['Y-m-d-h-i', false],
['Y-', false],
['Y-m-', false],
['Y--', false],
['m-d', false],
['Y-d', false]
];
}