Category : lazy-loading

How to inject in a Symfony service the Logger component in lazy mode using DI. My intention is to log information in some methods. The logger instance must be created at the first time is used. Something like this: namespace AppServices; use PsrLogLoggerInterface; class XxxService{ private $logger; public function some_method(){ echo "method without logging" return ..

Read more