This commit is contained in:
dongwei 2019-01-10 11:52:40 +08:00
parent 6cad04dc19
commit 4d33779ad0

View File

@ -4,6 +4,7 @@ namespace JsonRpc\Providers;
use Illuminate\Support\ServiceProvider;
use JsonRpc\Client;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
class ClientServiceProvider extends ServiceProvider
@ -19,7 +20,7 @@ class ClientServiceProvider extends ServiceProvider
$config = config('rpc.client');
$logger = new Logger('rpc-client-logger');
$logger->pushHandler($this->app->storagePath()."/logs/rpc_client_".date("Ymd").".log");
$logger->pushHandler(new StreamHandler($this->app->storagePath()."/logs/rpc_client_".date("Ymd").".log"));
$this->app->singleton('rpc', function () use ($config, $logger) {
return new Client($config, $logger);
});