Skip to content

Commit 3555d5a

Browse files
Fix support for monolog 3.0
1 parent d87cd8d commit 3555d5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Bridge/Monolog/Command/ServerLogCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
use Monolog\Formatter\FormatterInterface;
1515
use Monolog\Handler\HandlerInterface;
16+
use Monolog\Level;
1617
use Monolog\Logger;
18+
use Monolog\LogRecord;
1719
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
1820
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
1921
use Symfony\Component\Console\Attribute\AsCommand;
@@ -156,6 +158,16 @@ private function displayLog(OutputInterface $output, int $clientId, array $recor
156158
$logBlock = sprintf('<bg=%s> </>', self::BG_COLOR[$clientId % 8]);
157159
$output->write($logBlock);
158160

161+
if (Logger::API >= 3) {
162+
$record = new LogRecord(
163+
level: Level::fromValue($record['level']),
164+
channel: $record['channel'],
165+
context: $record['context']->getContext(),
166+
datetime: $record['datetime'],
167+
message: $record['message'],
168+
);
169+
}
170+
159171
$this->handler->handle($record);
160172
}
161173
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy