Closed dustinbolton closed 6 years ago
Hi @dustinbolton. Can not reproduce described issue. Do you use any framework? Could you show your handler configuration?
I narrowed down the problem to being related to using my own autoloader rather than composer. I'm not using a framework but using an autoloader as suggested in https://github.com/Seldaek/monolog/issues/265
I was able to get this to work by modifying your CloudWatch.php as follows to make the function match more exactly. Do you think this is an acceptable fix?
Inserted at line 9:
use Monolog\Formatter\FormatterInterface;
Changed line 331 from:
protected function getDefaultFormatter()
to
protected function getDefaultFormatter(): FormatterInterface
Hi @dustinbolton! This kind of change will make Handler incompatible with PHP versions lower then 7.0 and it is unacceptable for now. PHP 5.6 is still used by 16% of packagist.org users. I plan to drop old PHP version support by the end of the year.
Max.
I'm submitting a ...
Do you want to request a feature or report a bug? Bug
What is the current behavior? Does not work. Gives error: [27-Apr-2018 21:52:17 America/Chicago] PHP Fatal error: Declaration of Maxbanton\Cwh\Handler\CloudWatch::getDefaultFormatter() must be compatible with Monolog\Handler\AbstractProcessingHandler::getDefaultFormatter(): Monolog\Formatter\FormatterInterface in /site/classes/Maxbanton/Cwh/Handler/CloudWatch.php on line 10
Please tell about your environment: