mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°2518 Implementation to rotate logs on a weekly basis
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user