title: Custom monolog handler for default monolog in Symfony 2
body: <p>I want to add a custom handler to a default monolog in <a href="http://en.wikipedia.org/wiki/Symfony">Symfony</a> 2.</p>
  
  <p>In my <code>config.yaml</code> file, I have:</p>
  
  <pre><code>monolog:
      handlers:
          main:
              type:  stream
              path:  %kernel.logs_dir%/%kernel.environment%.log
              level: debug
          myHandler:
              type:  Acme\MyBundle\Monolog\MyCustomHandler
              level: error
  </code></pre>
  
  <p>My class looks like below:</p>
  
  <pre><code>// Acme\MyBundle\Monolog\MyCustomHandler
  use Monolog\Logger;
  use Monolog\Handler\SocketHandler;
  use Monolog\Formatter\LineFormatter;
  
  class MyCustomHandler extends AbstractProcessingHandler
  {
      ...
  }
  </code></pre>
  
  <p>But even before I fill my class in I get an error:</p>
  
  <blockquote>
    <p>invalid handler type "acme\mybundle\monolog\mycustomhandler" given for handler "myHandler"</p>
  </blockquote>
  
  <p>How do I add a custom handler to the default monolog without creating a new monolog service?</p>