Commit 1ba12885 authored by Liu lu's avatar Liu lu

更新日志记录

parent 450fab42
...@@ -71,7 +71,7 @@ class LogTraceHandler ...@@ -71,7 +71,7 @@ class LogTraceHandler
{ {
$workId = posix_getpid(); $workId = posix_getpid();
$cid = Context::get('log_trace_request_id'); $cid = Context::get('log_trace_request_id');
if(!$cid) throw new \Exception('无法使用协程标记录日志'); if(!$cid) return false;
return container(Server::class)->stats()['start_time'] .$workId. $cid; return container(Server::class)->stats()['start_time'] .$workId. $cid;
} }
...@@ -114,6 +114,8 @@ class LogTraceHandler ...@@ -114,6 +114,8 @@ class LogTraceHandler
} }
$logInfo .= "\n\n"; $logInfo .= "\n\n";
if(!self::getRequestId()) return ;
container(LogTraceQueue::class)->addToQueue([ container(LogTraceQueue::class)->addToQueue([
'request_id'=>self::getRequestId(), 'request_id'=>self::getRequestId(),
'process_info'=>$logInfo 'process_info'=>$logInfo
......
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