File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,21 @@ public function register(): void
5454 *
5555 * This is where we can start listening for events.
5656 *
57- * @param RollbarLogger $logger This parameter is injected by the service container, and is required to ensure that
58- * the Rollbar logger is initialized.
5957 * @return void
6058 *
6159 * @since 8.1.0
60+ * @since 8.1.1 Changed RollbarLogger from dependency injection to service locator.
6261 */
63- public function boot (RollbarLogger $ logger ): void
62+ public function boot (): void
6463 {
64+ // Get the RollbarLogger if it is bound. This is needed and is required to ensure that the Rollbar logger is
65+ // initialized. Without this, the telemetry listener will not be able to send telemetry events.
66+ try {
67+ $ logger = $ this ->app ->make (RollbarLogger::class);
68+ } catch (BindingResolutionException $ e ) {
69+ // RollbarLogger is not bound, so we can't set up telemetry.
70+ return ;
71+ }
6572 // Set up telemetry if it is enabled.
6673 if (null !== Rollbar::getTelemeter ()) {
6774 $ this ->setupTelemetry ($ this ->getConfigs ($ this ->app ));
You can’t perform that action at this time.
0 commit comments