作者 赵彬吉

update

@@ -35,14 +35,11 @@ class LogFormatterFactory @@ -35,14 +35,11 @@ class LogFormatterFactory
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 { 37 try {
38 - $group = posix_getgrgid(filegroup($path));  
39 - if ($group['name'] !== 'www') {  
40 - chgrp($path, 'www'); 38 + $owner = posix_getpwuid(fileowner($path));
  39 + if($owner['name'] !== 'www'){
  40 + chown($path, 'www');
41 } 41 }
42 - }catch (\Throwable $e){  
43 -  
44 - }  
45 - 42 + }catch (\Throwable $exception){}
46 43
47 return $handler; 44 return $handler;
48 } 45 }