作者 赵彬吉

update

... ... @@ -34,6 +34,16 @@ class LogFormatterFactory
$path = storage_path($path);
$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');
}
}catch (\Throwable $e){
}
return $handler;
}
... ...