Configuring Laravel to Create Log Files with Specific Permissions and Ownership

29 Views Asked by At

How can I configure Laravel to create log files with specific permissions, such as -rw-rw-r--, instead of the default permissions, -rw-r--r--? I want the log files to be owned by www-data:www-data instead of root:root upon creation."

enter image description here

1

There are 1 best solutions below

0
cengsemihsahin On

Modify the config/logging.php file. For example:

'channels' => [
    'single' => [
        'permission' => 0664,
    ],
],

The permission option is set to 0664, which corresponds to the desired permissions -rw-rw-r-- .

Also see this questions: