From ef2aab9c0a30adf48cc2bd99d179d7413ecd834f Mon Sep 17 00:00:00 2001 From: dongwei <838456736@qq.com> Date: Fri, 11 Jan 2019 15:53:39 +0800 Subject: [PATCH] client provider defer --- src/Client.php | 3 ++- src/Providers/ClientServiceProvider.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index e61d8fc..19325d0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -4,6 +4,7 @@ namespace JsonRpc; use GuzzleHttp\Exception\ServerException; use JsonRpc\Exception\RpcServerException; +use JsonRpc\Logging\LogstashFormatter; use Monolog\Handler\StreamHandler; use Monolog\Logger; @@ -24,7 +25,7 @@ class Client $default = [ 'app' => '***', 'log_path'=> "/logs/rpc_monitor_".date("Ymd").".log", - 'log_formatter' => 'JsonRpc\Logging\LogstashFormatter', + 'log_formatter' => LogstashFormatter::class, ]; $this->config = array_merge($default, $config); $stream = new StreamHandler(app()->storagePath().$this->config['log_path']); diff --git a/src/Providers/ClientServiceProvider.php b/src/Providers/ClientServiceProvider.php index 8560b48..5ddc669 100644 --- a/src/Providers/ClientServiceProvider.php +++ b/src/Providers/ClientServiceProvider.php @@ -8,6 +8,9 @@ use JsonRpc\Client; class ClientServiceProvider extends ServiceProvider { + + protected $defer = true; + /** * Register any application services. * @@ -29,4 +32,5 @@ class ClientServiceProvider extends ServiceProvider }); } } + } \ No newline at end of file