Parameter maxLogFiles (logfile rotation) has no effect


I’m using Yii 2.0.32 and tried to set the application-log rotation using this setting:

            'targets' => [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'maxFileSize' => 10240, 
                    'maxLogFiles' => 6 

While the maxFileSize parameter works fine, the maxLogFiles parameter seams to be ignored. I tried maxLogFiles with the value 4, 6, 10 and 20, But the systems holds 5 files in each case. (I set the maxFileSize to 10k while testing the different variations of maxLogFiles)

Is there a reason why this happens and is there a way to debug this?

Thank you,

No specific reason. Sounds like a bug. As for debugging it, it worth putting together a unit test with low limits and rotation turned on then validating number of files. When isolated, it will be easier to debug and fix it.