Skip to content

Commit e3897ca

Browse files
authored
Fix not setting correct SDK ID/version when running test command (#582)
1 parent cad98d8 commit e3897ca

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Fix not setting the correct SDK ID and version when running the `sentry:test` command (#582)
6+
57
## 2.14.0
68

79
- Fix not listening to queue events because `QueueManager` is registered as `queue` in the container and not by it's class name (#568)

src/Sentry/Laravel/Console/TestCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Str;
88
use Psr\Log\AbstractLogger;
99
use Sentry\ClientBuilder;
10+
use Sentry\Laravel\Version;
1011
use Sentry\State\Hub;
1112
use Sentry\State\HubInterface;
1213
use Sentry\Tracing\SpanContext;
@@ -99,6 +100,10 @@ public function handle(): int
99100
return 1;
100101
}
101102

103+
// Set the Laravel SDK identifier and version
104+
$clientBuilder->setSdkIdentifier(Version::SDK_IDENTIFIER);
105+
$clientBuilder->setSdkVersion(Version::SDK_VERSION);
106+
102107
// We set a logger so we can surface errors thrown internally by the SDK
103108
$clientBuilder->setLogger(new class($this) extends AbstractLogger {
104109
private $command;

0 commit comments

Comments
 (0)