diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 1e6676564..88c5cf16b 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -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, diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 3004d7fb5..c2db00c87 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -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 */