laravel10 cloudwatch error
usernamehogehoge opened this issue · comments
Monolog version 3.4.0
Write your bug report here.
In Laravel 10, install the library from the following URL to send logs to CloudWatch:
https://github.com/tarfin-labs/laravel-cloudwatch-logger
However, be aware that if the version of Monolog is 3.4.0, an error will occur:
"Declaration of Maxbanton\Cwh\Handler\CloudWatch::write(array $record): void must be compatible with Monolog\Handler\AbstractProcessingHandler::write(Monolog\LogRecord $record): void"
This issue can be resolved by downgrading Monolog to version 2.9.1.
So what you're saying is that library is not compatible with monolog 3. They have marked it as compatible at some point even though it wasn't, and then they reverted it maxbanton/cwh#110 - but the 2.0.3 release is still out there so Composer selects that thinking it will work.
Anyway tarfin-labs/laravel-cloudwatch-logger#8 would be the fix it seems. Until that's merged yes you gotta use Monolog 2.x.