1

My daily logs have the following permissions:

-rw-rw-rw- 1 root    root    108384 Mar 29 00:30 laravel-2016-03-28.log

This causes a Failed to open stream: Permission denied error

If I delete the log file, it will be recreated with the correct permissions.

-rw-rw-rw- 1 php-fpm php-fpm    819 Mar 28 18:04 laravel-2016-03-28.log

This stackoverflow solution seems to be working,

I added the following to bootstrap/app.php:

/**
 * Configure Monolog.
 */
$app->configureMonologUsing(function(Monolog\Logger $monolog) {
    $filename = storage_path('logs/laravel-'.php_sapi_name().'.log');
    $handler = new Monolog\Handler\RotatingFileHandler($filename);
    $monolog->pushHandler($handler);
});

However, I still have new daily logs being created by root:root. These logs are not being used for anything. Where are these logs being created and why are they being created with root:root?

What code handles the creation of these daily logs?

Community
  • 1
  • 1
zechdc
  • 3,374
  • 9
  • 40
  • 52
  • 1
    Are you running Artisan commands as root? – Roj Vroemen Mar 29 '16 at 22:59
  • @RojVroemen I'm not sure on that. I ran `crontab -e` as root and as our www-data but no artisan commands are showing up. Where does this Artisan command get run? – zechdc Mar 30 '16 at 15:39

0 Answers0