1

Based on information from these 2 posts:

https://laracasts.com/discuss/channels/laravel/log-file-permission-problem?page=1

Laravel daily log created with wrong permissions

I found a way how to resolve permissions problems with logs.

But still one problems remains: using this code I can configure permissions to created log file, but cannot do anything with user. Is there any way to create log that would belong to www-data user instead of me (root, etc)

$app->configureMonologUsing(function(Monolog\Logger $monolog) {
    $filename = storage_path().'/logs/laravel_custom.log';
    $handler = new Monolog\Handler\RotatingFileHandler($filename, 0, Logger::DEBUG,  true,  0777,  false);
    $monolog->pushHandler($handler);
});

enter image description here

Edit1:I want to change user from "demaunt" to "www-data" withing monolog function

Demaunt
  • 1,183
  • 2
  • 16
  • 26

0 Answers0