Please, Is there a quick way to have monolog service available in a an_other_service service without passing the monolog service reference as argument from a controller ?
Exactly I've created a custom monolog channel which is written to a specific log file. Normally in a controller I get my monolog custom service with
$this->logger = $this->container->get('monolog.logger.test');
For now I've got my custom log service passing the instance of the logger as an argument when I call a method of an_other_service service. Being in an_other_service service Is there a clear way to get access to a custom monolog ? and to the normal monolog service ?
inject the service in your service.
Documentation