mardi 29 mars 2016

What code handles the creation of laravel's daily logs?

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?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire