Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Monolog/LogsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
self::getSentryLogLevelFromMonologLevel($record['level']),
$record['message'],
[],
array_merge($record['context'], $record['extra'], ['sentry.origin' => 'auto.logger.monolog'])
$this->compileAttributes($record)
);

return $this->bubble === false;
Expand Down Expand Up @@ -123,4 +123,17 @@
// Just in case so that the destructor can never fail.
}
}

/**
* @param array<string, mixed>|LogRecord $record
*/
protected function compileAttributes($record): array

Check failure on line 130 in src/Monolog/LogsHandler.php

View workflow job for this annotation

GitHub Actions / PHPStan

Method Sentry\Monolog\LogsHandler::compileAttributes() return type has no value type specified in iterable type array.
{
return [
'log.context' => $record['context'],
'log.extra' => $record['extra'],
'log.channel' => $record['channel'],
'sentry.origin' => 'auto.logger.monolog',
];
}
}
Loading