Skip to content

Commit 8f3068f

Browse files
authored
Add Monolog channel to compiled log attributes
The channel is a relevant piece of metadata of a log entry. This change includes the channel in the recorded attributes, but remains backwards compatible and will not overwrite existing extra or context fields named 'channel'.
1 parent 9dc8fb0 commit 8f3068f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Monolog/LogsHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,6 @@ public function __destruct()
144144
*/
145145
protected function compileAttributes($record): array
146146
{
147-
return array_merge($record['context'], $record['extra'], ['sentry.origin' => 'auto.log.monolog']);
147+
return array_merge(['channel' => $record['channel']], $record['context'], $record['extra'], ['sentry.origin' => 'auto.log.monolog']);
148148
}
149149
}

0 commit comments

Comments
 (0)