Skip to content

Commit e8ca4fb

Browse files
committed
Refactor ChannelWrapper to only set log channel if it's not part of context
This is to allow local override of log channel. This can be needed if a class does say both payment and accounting and you want messages log to separate channels for does
1 parent cc70a36 commit e8ca4fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Wrapper/ChannelWrapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public function __construct(
1717
*/
1818
public function log($level, string|\Stringable $message, array $context = []): void
1919
{
20-
$context['channel'] = $this->channel;
20+
if (!isset($context['channel'])) {
21+
$context['channel'] = $this->channel;
22+
}
2123
$this->logger->log($level, $message, $context);
2224
}
2325
}

0 commit comments

Comments
 (0)