Max files in Laravel 5 logs

Ok, it's now possible since v5.0.23. You just need to update laravel, and add this in your config/app.php file:

'log_max_files' => 30

On Laravel 5.6 You can find config/logging.php file:

    'daily' => [
        'driver' => 'daily',
        'path' => storage_path('logs/laravel.log'),
        'level' => 'debug',
        'days' => 30, // 0 for unilimitted logs
    ],

There is a function in ConfigureLogging or LogServiceProvider or so (Since I'm using an old checkout I'm not sure where exactly), something called useDailyFiles. In that the file name and maximum file number is set and the default looks something like this:

$log->useDailyFiles(storage_path().'/logs/laravel.log', 5);

Change the last parameter (5) to your desired number of files.


On Laravel 5.6 open file config/logging.php on array daily change: 'days' => 30

If you want unlimited logs just put 0 instead 30.