File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -639,6 +639,10 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
639639 # that's defined in this file (including controller arguments)
640640 $adminEmail : ' manager@example.com'
641641
642+ # pass this service to any $requestLogger argument for any
643+ # service that's defined in this file
644+ $requestLogger : ' @monolog.logger.request'
645+
642646 # pass this service for any LoggerInterface type-hint for any
643647 # service that's defined in this file
644648 Psr\Log\LoggerInterface : ' @monolog.logger.request'
@@ -657,7 +661,11 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
657661 <services >
658662 <defaults autowire =" true" autoconfigure =" true" public =" false" >
659663 <bind key =" $adminEmail" >manager@example.com</bind >
660- <bind key =" $logger"
664+ <bind key =" $requestLogger"
665+ type =" service"
666+ id =" monolog.logger.request"
667+ />
668+ <bind key =" Psr\Log\LoggerInterface"
661669 type =" service"
662670 id =" monolog.logger.request"
663671 />
@@ -678,6 +686,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
678686 ->setPublic(true)
679687 ->setBindings(array(
680688 '$adminEmail' => 'manager@example.com',
689+ '$requestLogger' => new Reference('monolog.logger.request'),
681690 LoggerInterface::class => new Reference('monolog.logger.request'),
682691 ))
683692 ;
You can’t perform that action at this time.
0 commit comments