Skip to content
Closed
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
10 changes: 9 additions & 1 deletion src/Monolog/LogsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function handle($record): bool
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,12 @@ public function __destruct()
// Just in case so that the destructor can never fail.
}
}

/**
* @param array<string, mixed>|LogRecord $record
*/
protected function compileAttributes($record): array
{
return array_merge($record['context'], $record['extra'], ['sentry.origin' => 'auto.logger.monolog']);
}
}