N°2518 Implementation to rotate logs on a weekly basis

This commit is contained in:
Pierre Goiffon
2019-10-03 18:14:24 +02:00
parent 21ff03e28f
commit c3915ee48e
2 changed files with 15 additions and 1 deletions

View File

@@ -388,7 +388,7 @@ class Config
'log_filename_builder_impl' => array(
'type' => 'string',
'description' => 'Name of the ILogFileNameBuilder to use',
'default' => 'DailyRotatingLogFileNameBuilder',
'default' => 'WeeklyRotatingLogFileNameBuilder',
'value' => '',
'source_of_value' => '',
'show_in_conf_sample' => false,

View File

@@ -87,6 +87,20 @@ class DailyRotatingLogFileNameBuilder extends RotatingLogFileNameBuilder
}
}
/**
* @since 2.7.0 N°2518
*/
class WeeklyRotatingLogFileNameBuilder extends RotatingLogFileNameBuilder
{
protected function GetFileSuffix()
{
$sWeekYear = date('o');
$sWeekNumber = date('W');
return $sWeekYear.'-week'.$sWeekNumber;
}
}
/**
* @since 2.7.0 N°2518
*/