Commit b0966f8e authored by Liu lu's avatar Liu lu

致命级错误记录

parent 63f4a4e7
......@@ -36,12 +36,14 @@ class LogTraceAspect extends AbstractAspect
$originParams
);
$requestId = LogTraceHandler::getRequestId();
register_shutdown_function(function ()use($requestId) {
LogTraceHandler::recordProcess(
'致命级错误:'.json_encode(error_get_last()),
false,
$requestId
);
register_shutdown_function(function ()use($requestId,$originParams,$proceedingJoinPoint) {
put_log(array_merge([
'request_id'=>$requestId,'error_msg'=>error_get_last()
],$originParams),
str_replace('\\','_',$proceedingJoinPoint->className).
'/'.$proceedingJoinPoint->methodName
);
});
$result = $proceedingJoinPoint->process();
LogTraceHandler::recordProcess('返回结果:'.json_encode($result));
......
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