diff --git a/src/Provider/AppProvider.php b/src/Provider/AppProvider.php index 48eba66..5a47db5 100644 --- a/src/Provider/AppProvider.php +++ b/src/Provider/AppProvider.php @@ -22,6 +22,7 @@ use Illuminate\Contracts\Config\Repository; use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; +use Psr\Log\LoggerInterface; use Pusher\Pusher; @@ -167,6 +168,8 @@ protected function pusher() $encrypted = false; } + $options['debug'] = $this->app->inDebugMode(); + if ($cluster = $settings->get('kyrne-websocket.app_cluster')) { $options['cluster'] = $cluster; } else { @@ -176,7 +179,7 @@ protected function pusher() $options['scheme'] = $encrypted ? 'https' : 'http'; } - return new Pusher( + $pusher = new Pusher( $settings->get('kyrne-websocket.app_key'), $settings->get('kyrne-websocket.app_secret'), $settings->get('kyrne-websocket.app_id'), @@ -184,6 +187,12 @@ protected function pusher() $host, $port ); + + if ($this->app->inDebugMode()) { + $pusher->setLogger(app('log')); + } + + return $pusher; }); $this->app->alias(Pusher::class, 'websocket.pusher');