mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进命令行日志
This commit is contained in:
@@ -85,13 +85,11 @@ class File
|
|||||||
*/
|
*/
|
||||||
protected function getMasterLogFile()
|
protected function getMasterLogFile()
|
||||||
{
|
{
|
||||||
|
$cli = PHP_SAPI == 'cli' ? '_cli' : '';
|
||||||
if ($this->config['single']) {
|
if ($this->config['single']) {
|
||||||
$name = is_string($this->config['single']) ? $this->config['single'] : 'single';
|
$name = is_string($this->config['single']) ? $this->config['single'] : 'single';
|
||||||
|
$destination = $this->config['path'] . $name . $cli . '.log';
|
||||||
$destination = $this->config['path'] . $name . '.log';
|
|
||||||
} else {
|
} else {
|
||||||
$cli = PHP_SAPI == 'cli' ? '_cli' : '';
|
|
||||||
|
|
||||||
if ($this->config['max_files']) {
|
if ($this->config['max_files']) {
|
||||||
$filename = date('Ymd') . $cli . '.log';
|
$filename = date('Ymd') . $cli . '.log';
|
||||||
$files = glob($this->config['path'] . '*.log');
|
$files = glob($this->config['path'] . '*.log');
|
||||||
@@ -125,15 +123,13 @@ class File
|
|||||||
|
|
||||||
if ($this->config['single']) {
|
if ($this->config['single']) {
|
||||||
$name = is_string($this->config['single']) ? $this->config['single'] : 'single';
|
$name = is_string($this->config['single']) ? $this->config['single'] : 'single';
|
||||||
|
|
||||||
$name .= '_' . $type;
|
|
||||||
} elseif ($this->config['max_files']) {
|
} elseif ($this->config['max_files']) {
|
||||||
$name = date('Ymd') . '_' . $type . $cli;
|
$name = date('Ymd');
|
||||||
} else {
|
} else {
|
||||||
$name = date('d') . '_' . $type . $cli;
|
$name = date('d');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $path . DIRECTORY_SEPARATOR . $name . '.log';
|
return $path . DIRECTORY_SEPARATOR . $name . '_' . $type . $cli . '.log';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user