EkinoNewRelicBundle
EkinoNewRelicBundle copied to clipboard
Change AdaptiveHandler::write() argument type and update monolog/monolog requirement
When using the newrelic bundle on Symfony 6.2 and PHP 8.1 I get the following error:
Fatal error: Declaration of Ekino\NewRelicBundle\Logging\AdaptiveHandler::write(array $record): void must be compatible with Monolog\Handler\NewRelicHandler::write(Monolog\LogRecord $record): void in /var/www/html/vendor/ekino/newrelic-bundle/Logging/AdaptiveHandler.php on line 31
Since monolog/monolog v3.0.0
the argument type was changed from array
to LogRecord
(see: https://github.com/Seldaek/monolog/blame/main/src/Monolog/Handler/NewRelicHandler.php#L60).
I updated the argument type, as well as the required version of monolog/monolog
since the need to be compatible, it requires version v3.0.0
.
Note I also reviewed that PR https://github.com/ekino/EkinoNewRelicBundle/pull/281 but I introduce less changes in the hope to fix that specific issue.