Example:
http://laravel.local/404page - Generates an error, which is written to a new log file with permissions 644
php artisan unknowcmd - Generates an error and can not write it to a log file because the user running that script, do not have write this file because it was created by the www-data with permissions 644
If the log file will be created depending on the SAPI, or with permissions 777, then this problem will not.
If we use the daily log, then we'll have to do *chmod ugo+w storage/logs/** each time you create a new log file.
My solution to this problem was in this pull request https://github.com/laravel/framework/pull/6441
You should run your HTTP requests (web server) under the same user. Or you can run the artisan command as www-data with sudo -u www-data php artisan unknowncmd.
I don't think this is something the framework should address. Most server configurations will be running under the same user.
This solution is completely unacceptable. Securing a system requires separating concerns to different users. Why is it so hard for Laravel to simply use the permissions given by the file system? Laravel should not assume the application administrator is incompetent and "fix" the permissions on the filesystem. This is completely broken and leads to continuous problems in any secured environment.
Most helpful comment
This solution is completely unacceptable. Securing a system requires separating concerns to different users. Why is it so hard for Laravel to simply use the permissions given by the file system? Laravel should not assume the application administrator is incompetent and "fix" the permissions on the filesystem. This is completely broken and leads to continuous problems in any secured environment.