@@ -64,8 +64,9 @@ protected function configureStatisticsLogger()
64
64
65
65
$browser = new Browser($this->loop, $connector);
66
66
67
- app()->singleton(StatisticsLoggerInterface::class, function () use ($browser) {
68
- $class = config('websockets.statistics.logger', \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class);
67
+ app()->singleton(StatisticsLoggerInterface::class, function ($app) use ($browser) {
68
+ $config = $app['config']['websockets'];
69
+ $class = $config['statistics']['logger'] ?? \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class;
69
70
70
71
return new $class(app(ChannelManager::class), $browser);
71
72
});
@@ -79,9 +80,9 @@ protected function configureStatisticsLogger()
79
80
80
81
protected function configureHttpLogger()
81
82
{
82
- app()->singleton(HttpLogger::class, function () {
83
+ app()->singleton(HttpLogger::class, function ($app ) {
83
84
return (new HttpLogger($this->output))
84
- ->enable($this->option('debug') ?: config(' app. debug'))
85
+ ->enable($this->option('debug') ?: ($app['config'][' app'][' debug'] ?? false ))
85
86
->verbose($this->output->isVerbose());
86
87
});
87
88
@@ -90,9 +91,9 @@ protected function configureHttpLogger()
90
91
91
92
protected function configureMessageLogger()
92
93
{
93
- app()->singleton(WebsocketsLogger::class, function () {
94
+ app()->singleton(WebsocketsLogger::class, function ($app ) {
94
95
return (new WebsocketsLogger($this->output))
95
- ->enable($this->option('debug') ?: config(' app. debug'))
96
+ ->enable($this->option('debug') ?: ($app['config'][' app'][' debug'] ?? false ))
96
97
->verbose($this->output->isVerbose());
97
98
});
98
99
@@ -101,9 +102,9 @@ protected function configureMessageLogger()
101
102
102
103
protected function configureConnectionLogger()
103
104
{
104
- app()->bind(ConnectionLogger::class, function () {
105
+ app()->bind(ConnectionLogger::class, function ($app ) {
105
106
return (new ConnectionLogger($this->output))
106
- ->enable(config(' app. debug') )
107
+ ->enable($app[' config'][' app'][' debug'] ?? false )
107
108
->verbose($this->output->isVerbose());
108
109
});
109
110
0 commit comments