Skip to content

Commit

Permalink
Merge pull request #12 from worksome/bugfix/shutdown-logger
Browse files Browse the repository at this point in the history
fix: ensure that logger is shutdown
  • Loading branch information
owenvoke authored Jul 25, 2024
2 parents d2d5146 + 686958c commit a46c534
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LaravelTelemetryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ public function boot(): void
});

$this->app->terminating(function () {
if ($this->app->make(Repository::class)->get('telemetry.sdk.disabled')) {
return;
if ($this->app->resolved(LoggerProviderSdkInterface::class)) {
/** @var LoggerProviderSdkInterface $logger */
$logger = $this->app->get(LoggerProviderSdkInterface::class);
$logger->shutdown();
}

if ($this->app->resolved(MeterProviderSdkInterface::class)) {
Expand Down

0 comments on commit a46c534

Please sign in to comment.