Unable to resolve service "Psr\Log\LoggerInterface" to a factory; are you certain you provided it during configuration?

Hello,

I’am trying to use Phly\Swoole\TaskWorker\Task in a mezzio-swoole project.
When I start swoole using “vendor/bin/laminas mezzio:swoole:start” I receive error message:

In ServiceManager.php line 609:
Unable to resolve service “Psr\Log\LoggerInterface” to a factory; are you certain you provided it during configuration?

Please can anyone suggest how to solve this issue.

Thank you

Hello,
I can’t see your code as I think the Problem is suggesting You have not created the Factory,

or if You have created the Factory it is not being called correctly. you may created in the wrong directory. Please check that.

you have to build your own code, and than registry it as a factory or invokable(if no dependency injection needed)

composer require psr/log

@Alban_Hasa If you are using Monolog, I can recommend GitHub - nikolaposa/monolog-factory: 🏭 Configuration-based Monolog logger factory. .