title: Why logger service can't be injected in the CompilerPass?
body: <p>I execute this command</p>
  
  <pre><code>app/console container:debug | grep logger
  </code></pre>
  
  <p>clearly, there is a service named <code>logger</code>:</p>
  
  <pre><code> logger                                                             Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.assetic                                             Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.doctrine                                            Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.event                                               Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.php                                                 Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.profiler                                            Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.request                                             Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.router                                              Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.security                                            Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.templating                                          Symfony\Bridge\Monolog\Logger                                                              
   monolog.logger.translation                                         Symfony\Bridge\Monolog\Logger                                                              
   swiftmailer.mailer.default.plugin.messagelogger                    Swift_Plugins_MessageLogger                                                                
   swiftmailer.plugin.messagelogger                                   alias for "swiftmailer.mailer.default.plugin.messagelogger"     
  </code></pre>
  
  <p>I inject the service using this code:</p>
  
  <pre><code>public function process(ContainerBuilder $container)
  {
      $clients= $container-&gt;findTaggedServiceIds('socket.client');
  
      foreach ($clients as $id =&gt; $tags) {
          $definition = $container-&gt;getDefinition($id);
          $definition-&gt;addArgument($container-&gt;getDefinition('logger'));
      }
  }
  </code></pre>
  
  <p>But I got this error:</p>
  
  <blockquote>
    <p>Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
    The service definition "logger" does not exist.</p>
  </blockquote>
  
  <p>If change the <code>logger</code> service to <code>monolog.logger.doctrine</code>, then everything is fine, what happened with logger service?</p>
  
  <p>Another interesting thing is that  even though  the above way didn't work , it works in in yml, I can inject the <code>logger</code> service</p>
  
  <pre><code>services:
      etc.socket.server:
          class: %etc.socket.server.class%
          arguments: [@logger, @event_dispatcher, @etc.encoder,@etc.message.client.request]
  </code></pre>
  
  <p>the reason I have to inject the logger service in code , because I have several  <code>socket.client</code> services, and they are defined in the code.</p>
  
  <h3>Update:</h3>
  
  <p>I can find the  logger service definition in  appDevDebugProjectContainer.xml : </p>
  
  <pre><code> &lt;service id="logger" class="Symfony\Bridge\Monolog\Logger"&gt;
        &lt;argument&gt;app&lt;/argument&gt;
        &lt;call method="pushHandler"&gt;
          &lt;argument type="service" id="monolog.handler.console"/&gt;
        &lt;/call&gt;
        &lt;call method="pushHandler"&gt;
          &lt;argument type="service" id="monolog.handler.main"/&gt;
        &lt;/call&gt;
        &lt;call method="pushHandler"&gt;
          &lt;argument type="service" id="monolog.handler.debug"/&gt;
        &lt;/call&gt;
   &lt;/service&gt;
  </code></pre>
  
  <p>even though I write a compile pass to inject the logger service , it still doesn't work </p>
  
  <pre><code>public function process(ContainerBuilder $container)
      {
  
          $clients = $container-&gt;findTaggedServiceIds('micro_pay.socket.client');
  
          foreach ($clients as $id =&gt; $tags) {
              $definition = $container-&gt;getDefinition($id);
  
               $loggerDefinition=$container-&gt;findDefinition('logger');  //$loggerDefinition  is null
  //            $definition-&gt;addArgument($loggerDefinition);  
          }
      }
  </code></pre>
  
  <p>why the logger service is such special? </p>