-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
logging/src/Sentry/SentryLogger.php
Lines 63 to 94 in 2cc959b
| public function log($message, string $priority = ILogger::INFO): void | |
| { | |
| if (!in_array($priority, $this->allowedPriority, true)) { | |
| return; | |
| } | |
| $level = $this->getLevel($priority); | |
| if ($level === null) { | |
| return; | |
| } | |
| $scope = (new Scope())->setLevel(new Severity($level)); | |
| $this->makeRequest($message, $scope); | |
| } | |
| /** | |
| * @param mixed $message | |
| */ | |
| protected function makeRequest($message, Scope $scope): void | |
| { | |
| $client = ClientBuilder::create($this->configuration[self::CONFIG_OPTIONS] + ['dsn' => $this->configuration[self::CONFIG_URL]]) | |
| ->getClient(); | |
| SentrySdk::init()->bindClient($client); | |
| if ($message instanceof Throwable) { | |
| $client->captureException($message, $scope); | |
| } else { | |
| $client->captureMessage($message, null, $scope); | |
| } | |
| } |
method
log can accept message of type mixed. In my case it was array. But bit lower makeRequest is unable to process anything other than Throwable or string, since \Sentry\ClientInterface::captureMessage accepts only string message.
Where that array came from? https://github.com/nette/tracy/blob/024db76dc63e48afddddaa69792e453e54260707/src/Bridges/Psr/TracyToPsrLoggerAdapter.php#L50
Im not sure what would be fix here. Just reporting this issue.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Triage: Now