作者 赵彬吉

update

... ... @@ -35,14 +35,11 @@ class LogFormatterFactory
$handler = new StreamHandler($path, $level, false);
$handler->setFormatter(new LineFormatter(null, 'Y-m-d H:i:s', false, true));
try {
$group = posix_getgrgid(filegroup($path));
if ($group['name'] !== 'www') {
chgrp($path, 'www');
$owner = posix_getpwuid(fileowner($path));
if($owner['name'] !== 'www'){
chown($path, 'www');
}
}catch (\Throwable $e){
}
}catch (\Throwable $exception){}
return $handler;
}
... ...