I have a problem with a file named storage\logs\laravel.log From LARAVEL Project Files The strange thing is that this file is automatically increased in size every day, so I needed to delete it so that the site would not stop working Do you have a solution to this problem how to stop this file from working automatically So that the site does not stop because there is no free space
CodePudding user response:
You can change logging driver to daily
. This will create new log file daily, with date in file name.
in config/logging.php
'default' => env('LOG_CHANNEL', 'daily'),
'channels' => [
....
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
....
Set the number days that you want log files to keep. After that the old log files will be deleted automatically.
For more information Check the Laravel documentation for Logging.