Commit a5ee47bf authored by Liu lu's avatar Liu lu

日志优化

parent bcbf4b57
...@@ -45,7 +45,7 @@ class LogTraceAspect extends AbstractAspect ...@@ -45,7 +45,7 @@ class LogTraceAspect extends AbstractAspect
$requestId = LogTraceHandler::getRequestId(); $requestId = LogTraceHandler::getRequestId();
register_shutdown_function(function ()use($requestId,$originParams,$proceedingJoinPoint) { register_shutdown_function(function ()use($requestId,$originParams,$proceedingJoinPoint) {
put_log(array_merge([ put_log(json_encode([
'request_id'=>$requestId,'error_msg'=>error_get_last() 'request_id'=>$requestId,'error_msg'=>error_get_last()
],$originParams), ],$originParams),
str_replace('\\','_',$proceedingJoinPoint->className). str_replace('\\','_',$proceedingJoinPoint->className).
......
...@@ -103,13 +103,10 @@ class LogTraceHandler ...@@ -103,13 +103,10 @@ class LogTraceHandler
$track->getFile() . " line:" . $track->getFile() . " line:" .
$track->getLine() . "\n" . $track->getLine() . "\n" .
$track->getTraceAsString(); $track->getTraceAsString();
} }else if (is_string($track)||is_numeric($track)) {
if (is_array($track)) {
$logInfo = var_export($track, true);
}
if (is_string($track)||is_numeric($track)) {
$logInfo = $track; $logInfo = $track;
}else{
$logInfo = print_r($track, true);
} }
$logInfo .= "\n\n"; $logInfo .= "\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment