symfony/symfony — pull request #3417 by mlehner (2012-02-22 20:57:10+00:00)
Title: [MonologBundle] allow a fully qualified service_id for the handler parameter

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

I created a custom Monolog handler to submit logs to Graylog2 for storage. I wanted to add some processors to this handler only, but if I set the handler parameter to gelf on the tag for the processor I received a service not found exception (monolog.handler.gelf). I am not sure if this is the best fix for the situation, but it did resolve it for me. Sample configuration follows.

```
services:
tellecore_api.monolog.handler.gelf:
class: Tellecore\Monolog\Handler\GELFHandler
arguments:
publisher: "@tellecore_api.gelf.message_publisher"
system_name: %system_name%
level: debug

monolog.processor.introspection:
class: Monolog\Processor\IntrospectionProcessor
tags:
- { name: monolog.processor, handler: tellecore_api.monolog.handler.gelf }

monolog.processor.web:
class: Monolog\Processor\WebProcessor
tags:
- { name: monolog.processor, handler: tellecore_api.monolog.handler.gelf }

monolog:
handlers:
gelf:
type: service
id: tellecore_api.monolog.handler.gelf
```