@@ -64,8 +64,9 @@ protected function configureStatisticsLogger()
6464
6565 $ browser = new Browser ($ this ->loop , $ connector );
6666
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;
6970
7071 return new $ class (app (ChannelManager::class), $ browser );
7172 });
@@ -79,9 +80,9 @@ protected function configureStatisticsLogger()
7980
8081 protected function configureHttpLogger ()
8182 {
82- app ()->singleton (HttpLogger::class, function () {
83+ app ()->singleton (HttpLogger::class, function ($ app ) {
8384 return (new HttpLogger ($ this ->output ))
84- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
85+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
8586 ->verbose ($ this ->output ->isVerbose ());
8687 });
8788
@@ -90,9 +91,9 @@ protected function configureHttpLogger()
9091
9192 protected function configureMessageLogger ()
9293 {
93- app ()->singleton (WebsocketsLogger::class, function () {
94+ app ()->singleton (WebsocketsLogger::class, function ($ app ) {
9495 return (new WebsocketsLogger ($ this ->output ))
95- ->enable ($ this ->option ('debug ' ) ?: config ( ' app. debug ' ))
96+ ->enable ($ this ->option ('debug ' ) ?: ( $ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false ))
9697 ->verbose ($ this ->output ->isVerbose ());
9798 });
9899
@@ -101,9 +102,9 @@ protected function configureMessageLogger()
101102
102103 protected function configureConnectionLogger ()
103104 {
104- app ()->bind (ConnectionLogger::class, function () {
105+ app ()->bind (ConnectionLogger::class, function ($ app ) {
105106 return (new ConnectionLogger ($ this ->output ))
106- ->enable (config ( ' app. debug ') )
107+ ->enable ($ app [ ' config ' ][ ' app ' ][ ' debug '] ?? false )
107108 ->verbose ($ this ->output ->isVerbose ());
108109 });
109110
0 commit comments