Search code examples
laravellaravel-7

I have a problem in Laravel daily log file permission error


I'm using the Laravel daily log file, and sometimes I get the following error. However, I've added the permission attribute in the logging file.

The stream or file laravel-2021-08-02.log could not be opened in append mode: chmod(): Operation not permitted

'daily' => [ 
    'driver' => 'daily', 
    'path' => storage_path('logs/laravel.log'), 
    'level' => 'debug', 
    'days' => 7,
    'permission' => 0664 
]

Solution

  • Make sure your old laravel.log file has the same permission. 'permission' => 0664 this will work for future log files.