diff --git a/src/Providers/ClientServiceProvider.php b/src/Providers/ClientServiceProvider.php index 1a03646..3354328 100644 --- a/src/Providers/ClientServiceProvider.php +++ b/src/Providers/ClientServiceProvider.php @@ -4,6 +4,7 @@ namespace JsonRpc\Providers; use Illuminate\Support\ServiceProvider; use JsonRpc\Client; +use Monolog\Formatter\LineFormatter; use Monolog\Handler\StreamHandler; use Monolog\Logger; @@ -19,8 +20,13 @@ class ClientServiceProvider extends ServiceProvider $this->app->configure('rpc'); $config = config('rpc.client'); - $logger = new Logger('rpc-client-logger'); - $logger->pushHandler(new StreamHandler($this->app->storagePath()."/logs/rpc_monitor_".date("Ymd").".log")); + $dateFormat = "Y n j, g:i a"; + $output = "%datetime% > %level_name% > %message% %context% %extra%\n"; + $formatter = new LineFormatter($output, $dateFormat); + $stream = new StreamHandler($this->app->storagePath()."/logs/rpc_monitor_".date("Ymd").".log"); + $stream->setFormatter($formatter); + $logger = new Logger('RPC.LOGGER'); + $logger->pushHandler($stream); $this->app->singleton('rpc', function () use ($config, $logger) { return new Client($config, $logger); });