I have Laravel 5.1. It logs CGI (web stuff) with the apache account and that's fine. The problem is if I need to get on there to run an artisan command that I created (that also uses the Log class) it fails because it doesn't have permission to write to the log file that apache created. Is there a way to tell laravel to log to different places based on whether it's via web or cli?
Asked
Active
Viewed 785 times
1 Answers
2
Heading to your config/app.php file you can choose the Log driver according to the executing user.
config/app.php
/*...*/
'log' => php_sapi_name() === 'cli' ? 'syslog' : 'daily',
/*...*/
You can also change the log detail level if you want to mute it completely.