Skip to content

Commit

Permalink
fix:优化logger获取
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Oct 15, 2021
1 parent fa802fd commit aaaf3de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/Core/Log/LoggerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ protected function getLogger($channel) : LoggerInterface {
$logger = $this->createLogger($channel, $this->channelsConfig[$channel]);
$this->registerLogger($channel, $logger);
}
if (empty($this->loggerMap[$channel])) {
$channel = $this->defaultChannel;
if (empty($this->loggerMap[$channel]) && $channel !== $this->defaultChannel) {
return $this->getLogger($this->defaultChannel);
}

if (!empty($this->loggerMap[$channel]) && $this->loggerMap[$channel] instanceof MonoLogger) {
Expand Down

0 comments on commit aaaf3de

Please sign in to comment.