modified 优化日志内容

This commit is contained in:
zhaoxiang 2019-07-01 14:50:34 +08:00
parent 4206251226
commit 68bd16eefb
2 changed files with 5 additions and 4 deletions

View File

@ -14,11 +14,13 @@ class ApiLog {
*/
public function handle($request, \Closure $next) {
$response = $next($request);
$requestInfo = $request->param();
unset($requestInfo['API_CONF_DETAIL']);
unset($requestInfo['APP_CONF_DETAIL']);
ApiLogTool::setApiInfo($request->API_CONF_DETAIL);
ApiLogTool::setAppInfo($request->APP_CONF_DETAIL);
ApiLogTool::setRequest($request->param());
ApiLogTool::setResponse($response->getData());
ApiLogTool::setRequest($requestInfo);
ApiLogTool::setResponse($response->getData(), $response->getData()['code']);
ApiLogTool::setHeader($request->header());
ApiLogTool::save();

View File

@ -81,7 +81,6 @@ class ApiLogTool {
@file_put_contents($logPath . date('YmdH') . '.log', $logStr . "\n", FILE_APPEND);
}
/**
* @param string $log 被记录的内容
* @param string $type 日志文件名称