Reputation: 417
How can I configure my Laravel or Ubuntu server so my Laravel logger creates a log file with the 664 permissions? Right now it defaults to 644.
Upvotes: 3
Views: 1003
Reputation: 943
Open config\logging.php
file and add permission
key to your default log channel. Is seems that this feature is available from Laravel 5.6.10.
Example:
return [
'channels' => [
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'permission' => 0664, // this is the new key to add
],
],
];
Notes:
single
permission
key has the value without quotes and with leading zero. read more about this in php manual of chmodUpvotes: 3