作者 赵彬吉

update

... ... @@ -32,8 +32,7 @@ class LogFormatterFactory
$path = date('Y-m', $time) . '/' . date('d', $time) . '_' . $suffix . '.log';
$path = 'logs/' . $config['prefix'] . '/' . $path;
$path = storage_path($path);
$handler = new StreamHandler($path, $level, false);
$handler->setFormatter(new LineFormatter(null, 'Y-m-d H:i:s', false, true));
try {
$owner = posix_getpwuid(fileowner($path));
if($owner['name'] !== 'www'){
... ... @@ -41,6 +40,9 @@ class LogFormatterFactory
}
}catch (\Throwable $exception){}
$handler = new StreamHandler($path, $level, false);
$handler->setFormatter(new LineFormatter(null, 'Y-m-d H:i:s', false, true));
return $handler;
}
... ...