user_id); if ($success) { // 记录成功日志 Log::info('用户清空日志成功', [ 'user_id' => $this->user_id ]); } else { // 记录失败日志 Log::warning('用户清空日志失败', [ 'user_id' => $this->user_id ]); } return $response; } catch (\Exception $e) { Log::error('用户清空日志异常', [ 'user_id' => $this->user_id, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); // 重新抛出异常,交由框架处理 throw $e; } } }