mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进命令行的日志json格式
This commit is contained in:
@@ -154,19 +154,23 @@ class File
|
|||||||
$info['timestamp'] = date($this->config['time_format']);
|
$info['timestamp'] = date($this->config['time_format']);
|
||||||
|
|
||||||
foreach ($message as $type => $msg) {
|
foreach ($message as $type => $msg) {
|
||||||
$info[$type] = is_array($msg) ? implode("\r\n", $msg) : $msg;
|
$msg = is_array($msg) ? implode("\r\n", $msg) : $msg;
|
||||||
|
if (PHP_SAPI == 'cli') {
|
||||||
|
$info['msg'] = $msg;
|
||||||
|
$info['type'] = $type;
|
||||||
|
error_log($this->parseCliLog($info), 3, $destination);
|
||||||
|
} else {
|
||||||
|
$info[$type] = $msg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PHP_SAPI == 'cli') {
|
if (PHP_SAPI != 'cli') {
|
||||||
$message = $this->parseCliLog($info);
|
|
||||||
} else {
|
|
||||||
// 添加调试日志
|
// 添加调试日志
|
||||||
$this->getDebugLog($info, $append, $apart);
|
$this->getDebugLog($info, $append, $apart);
|
||||||
|
|
||||||
$message = $this->parseLog($info);
|
$message = $this->parseLog($info);
|
||||||
|
return error_log($message, 3, $destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
return error_log($message, 3, $destination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user