Skip to content

Commit 921493a

Browse files
committed
ref(logs): use Arr utility to simplify attribute compilation in compileAttributes method
1 parent 9dcb383 commit 921493a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Monolog/LogsHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Monolog\LogRecord;
1111
use Sentry\Logs\LogLevel;
1212
use Sentry\Logs\Logs;
13+
use Sentry\Util\Arr;
1314

1415
class LogsHandler implements HandlerInterface
1516
{
@@ -130,8 +131,8 @@ public function __destruct()
130131
protected function compileAttributes($record): array
131132
{
132133
return [
133-
'log.context' => $record['context'],
134-
'log.extra' => $record['extra'],
134+
...Arr::simpleDot(['context' => $record['context']]),
135+
...Arr::simpleDot(['extra' => $record['extra']]),
135136
'log.channel' => $record['channel'],
136137
'sentry.origin' => 'auto.logger.monolog',
137138
];

0 commit comments

Comments
 (0)