From 2fe16ea344ca8c72b0ce0cf2086e7da08272e9fc Mon Sep 17 00:00:00 2001 From: dongwei <838456736@qq.com> Date: Thu, 10 Jan 2019 14:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Client.php | 3 +-- src/Providers/ClientServiceProvider.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index 3350c9a..d2e5b65 100644 --- a/src/Client.php +++ b/src/Client.php @@ -90,11 +90,10 @@ class Client try { $body = \GuzzleHttp\json_decode($resp->getBody(), true); - if (isset($body['error']) && isset($body['error']['code']) && isset($body['error']['message'])) { throw new RpcServerException($body['error']['message'], $body['error']['code']); } - $this->logger->info('this is a test call log'); + $this->logger->info('MONITOR',compact("payload", "body")); return $body['result']; } catch (\InvalidArgumentException $e) { diff --git a/src/Providers/ClientServiceProvider.php b/src/Providers/ClientServiceProvider.php index 8dd7b0f..1a03646 100644 --- a/src/Providers/ClientServiceProvider.php +++ b/src/Providers/ClientServiceProvider.php @@ -20,7 +20,7 @@ class ClientServiceProvider extends ServiceProvider $config = config('rpc.client'); $logger = new Logger('rpc-client-logger'); - $logger->pushHandler(new StreamHandler($this->app->storagePath()."/logs/rpc_client_".date("Ymd").".log")); + $logger->pushHandler(new StreamHandler($this->app->storagePath()."/logs/rpc_monitor_".date("Ymd").".log")); $this->app->singleton('rpc', function () use ($config, $logger) { return new Client($config, $logger); });