作者 赵彬吉

update

@@ -34,6 +34,16 @@ class LogFormatterFactory @@ -34,6 +34,16 @@ class LogFormatterFactory
34 $path = storage_path($path); 34 $path = storage_path($path);
35 $handler = new StreamHandler($path, $level, false); 35 $handler = new StreamHandler($path, $level, false);
36 $handler->setFormatter(new LineFormatter(null, 'Y-m-d H:i:s', false, true)); 36 $handler->setFormatter(new LineFormatter(null, 'Y-m-d H:i:s', false, true));
  37 + try {
  38 + $group = posix_getgrgid(filegroup($path));
  39 + if ($group['name'] !== 'www') {
  40 + chgrp($path, 'www');
  41 + }
  42 + }catch (\Throwable $e){
  43 +
  44 + }
  45 +
  46 +
37 return $handler; 47 return $handler;
38 } 48 }
39 49