2

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. enter image description here

Neavehni
  • 337
  • 1
  • 2
  • 14

1 Answers1

2

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:

  • in this example the default log channel is single
  • make sure the permission key has the value without quotes and with leading zero. read more about this in php manual of chmod
Binar Web
  • 867
  • 1
  • 11
  • 26