Closed halfpastfouram closed 6 years ago
I was going to ask why on earth Zend\Log\Logger
does not implement Psr\Log\LoggerInterface
if it implements PSR-3. Then I read https://github.com/zendframework/zend-log/issues/35 which makes sense.
I do however prefer developing against interfaces so I rather not drop the requirement. To use Zend one could create a wrapper class which implements the Psr\Log\LoggerInterface
but forwards the logging request to the original class.
I understand. But this means that this middleware (tested with zend-expressive) does not support Zend's logger. It might be helpful to add that to the README.md.
Zend seems to provide PsrLoggerAdapter for this usecase.
The class
Tuupola\Middleware\CorsMiddleware
requires the supplied logger to be an instance ofPsr\Log\LoggerInterface
.This means any PSR-3 logger that does not implement that interface, like
Zend\Log\Logger
, cannot be used.Are you willing to remove the requirement of the interface so that all PSR-3 compliant loggers can be allowed?