diff --git a/config/websockets.php b/config/websockets.php index 1c9f61f..13aac01 100644 --- a/config/websockets.php +++ b/config/websockets.php @@ -191,9 +191,13 @@ return [ | store them into an array and then store them into the database | on each interval. | + | You can opt-in to avoid any statistics storage by setting the logger + | to the built-in NullLogger. + | */ - 'logger' => BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class, + 'logger' => \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class, + // 'logger' => \BeyondCode\LaravelWebSockets\Statistics\Logger\NullStatisticsLogger::class, /* |-------------------------------------------------------------------------- diff --git a/src/Facades/StatisticsLogger.php b/src/Facades/StatisticsLogger.php index 9aadfa7..5183342 100644 --- a/src/Facades/StatisticsLogger.php +++ b/src/Facades/StatisticsLogger.php @@ -6,7 +6,7 @@ use BeyondCode\LaravelWebSockets\Statistics\Logger\StatisticsLogger as Statistic use Illuminate\Support\Facades\Facade; /** - * @see \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger + * @see \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger * @mixin \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger */ class StatisticsLogger extends Facade diff --git a/src/Statistics/Logger/NullStatisticsLogger.php b/src/Statistics/Logger/NullStatisticsLogger.php new file mode 100644 index 0000000..885703e --- /dev/null +++ b/src/Statistics/Logger/NullStatisticsLogger.php @@ -0,0 +1,47 @@ +channelManager = $channelManager; + $this->browser = $browser; + } + + public function webSocketMessage(ConnectionInterface $connection) + { + // + } + + public function apiMessage($appId) + { + // + } + + public function connection(ConnectionInterface $connection) + { + // + } + + public function disconnection(ConnectionInterface $connection) + { + // + } + + public function save() + { + // + } +}