client provider defer

This commit is contained in:
dongwei 2019-01-11 15:53:39 +08:00
parent 213b742c39
commit ef2aab9c0a
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ namespace JsonRpc;
use GuzzleHttp\Exception\ServerException; use GuzzleHttp\Exception\ServerException;
use JsonRpc\Exception\RpcServerException; use JsonRpc\Exception\RpcServerException;
use JsonRpc\Logging\LogstashFormatter;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Logger; use Monolog\Logger;
@ -24,7 +25,7 @@ class Client
$default = [ $default = [
'app' => '***', 'app' => '***',
'log_path'=> "/logs/rpc_monitor_".date("Ymd").".log", 'log_path'=> "/logs/rpc_monitor_".date("Ymd").".log",
'log_formatter' => 'JsonRpc\Logging\LogstashFormatter', 'log_formatter' => LogstashFormatter::class,
]; ];
$this->config = array_merge($default, $config); $this->config = array_merge($default, $config);
$stream = new StreamHandler(app()->storagePath().$this->config['log_path']); $stream = new StreamHandler(app()->storagePath().$this->config['log_path']);

View File

@ -8,6 +8,9 @@ use JsonRpc\Client;
class ClientServiceProvider extends ServiceProvider class ClientServiceProvider extends ServiceProvider
{ {
protected $defer = true;
/** /**
* Register any application services. * Register any application services.
* *
@ -29,4 +32,5 @@ class ClientServiceProvider extends ServiceProvider
}); });
} }
} }
} }