there are three main "creators" of the file:
- www-data user (apache or nginx server)
- user defined when running scheduled commands defined cron (root, www-data or whoever specified)
- your local user when running
php artisan tinker(either your non-privileged account, or a root)
the easiest way is to use the same user all the time
- no tweaking needed
- if running scheduled commands, have a look at /etc/cron.d/ ... or users crontab and try to run it under
www-datauser - when running
php artisan tinkeruse sudo.sudo -u www-data php artisan tinkerthat way the log files shgould be created under the same user, so you have appropriate permissions all the time
but i would suggest looking at "extended acl" (setfacl command, use google to get some explanation) which can handle the permissions "on steroids", but it might be a pain to grasp at first