SULU CMS - How to solve AWS log problem maxbanton/cwh with Symfony 6/PHP8

117 views Asked by At

I have a project developed in Sulu CMS v2.5.10, and I updated my Symfony to v6, and PHP to v8.2, and in project I have package:

maxbenton/cwh v2.0.4

App is returning next error:

!!  PHP Fatal error:  Declaration of Maxbanton\Cwh\Handler\CloudWatch::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void in /var/www/html/vendor/maxbanton/cwh/src/Handler/CloudWatch.php on line 164
!!  PHPERROR: 
!!  Fatal error: Declaration of Maxbanton\Cwh\Handler\CloudWatch::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void in /var/www/html/vendor/maxbanton/cwh/src/Handler/CloudWatch.php on line 164
!!  Symfony\Component\ErrorHandler\Error\FatalError {#8833
!!    #message: "Compile Error: Declaration of Maxbanton\Cwh\Handler\CloudWatch::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void"
!!    #code: 0
!!    #file: "./vendor/maxbanton/cwh/src/Handler/CloudWatch.php"
!!    #line: 164
!!    -error: array:4 [
!!      "type" => 64
!!      "message" => "Declaration of Maxbanton\Cwh\Handler\CloudWatch::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void"
!!      "file" => "/var/www/html/vendor/maxbanton/cwh/src/Handler/CloudWatch.php"
!!      "line" => 164
!!    ]
!!  }
!! 

Any Idea how to solve this?

1

There are 1 answers

0
Jeff Ward On BEST ANSWER

Switch to

composer require phpnexus/cwh

PhpNexus\Cwh\Handler\CloudWatch