Support the ongoing development of Laravel.io →
Logging Laravel

When cron runs on the server and we add the Laravel log within the cron file the owner of the laravel.log file gets changed. If there is user www-data which used for executing normal PHP files on the server. When we add the logs within that file, the owner of the laravel.log file gets set as www-data. After executing the cron from the server, the owner of the laravel.log file gets changed to another user in my case "sysadm", which is used for the FTP and SSH login).

Once the owner of the laravel.log file gets changed, then the log file will not get updated using system files. It gives permission to deny error.

How we can resolve this type of issue.

Last updated 3 years ago.
0
moderator

If possible try to run the cronjobs with the same user as the website (in your situation www-data)

Else you need to check the group access on the log files and put the users in the same group.

The last resort is to set the permissions wide open ( chmod 0777) but that is not preferable.

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.