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); });