{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/MonologBundle/issues/121","labels_url":"https://api.github.com/repos/symfony/MonologBundle/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/symfony/MonologBundle/issues/121/comments","events_url":"https://api.github.com/repos/symfony/MonologBundle/issues/121/events","html_url":"https://github.com/symfony/MonologBundle/pull/121","id":75589111,"number":121,"title":"separated wire of handlers to channels","user":{"login":"nahpeps","id":1199756,"avatar_url":"https://avatars.githubusercontent.com/u/1199756?v=3","gravatar_id":"","url":"https://api.github.com/users/nahpeps","html_url":"https://github.com/nahpeps","followers_url":"https://api.github.com/users/nahpeps/followers","following_url":"https://api.github.com/users/nahpeps/following{/other_user}","gists_url":"https://api.github.com/users/nahpeps/gists{/gist_id}","starred_url":"https://api.github.com/users/nahpeps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nahpeps/subscriptions","organizations_url":"https://api.github.com/users/nahpeps/orgs","repos_url":"https://api.github.com/users/nahpeps/repos","events_url":"https://api.github.com/users/nahpeps/events{/privacy}","received_events_url":"https://api.github.com/users/nahpeps/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T12:41:40Z","updated_at":"2015-05-12T12:51:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/MonologBundle/pulls/121","html_url":"https://github.com/symfony/MonologBundle/pull/121","diff_url":"https://github.com/symfony/MonologBundle/pull/121.diff","patch_url":"https://github.com/symfony/MonologBundle/pull/121.patch"},"body":"moved the wire process to a separate function to allow compiler passes\r\nof other bundles to add custom log channels.\r\n\r\nThe additional function makes it more easy to add dynamic channels like this:\r\n\r\n```php\r\n\r\nnamespace BaseBundle\\DependencyInjection\\CompilerPass;\r\n\r\nuse Symfony\\Bundle\\MonologBundle\\DependencyInjection\\Compiler\\LoggerChannelPass;\r\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\r\nuse Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException;\r\nuse Symfony\\Component\\DependencyInjection\\Reference;\r\n\r\nclass LoggerChannelCompilerPass extends LoggerChannelPass {\r\n\r\n    /**\r\n     * @param ContainerBuilder $container\r\n     * @api\r\n     */\r\n    public function process(ContainerBuilder $container)\r\n    {\r\n\r\n        $serviceList = $container->getParameter('service_list');\r\n\r\n        foreach ($serviceList as $serviceIdentifier) {\r\n            $channel = 'my.channel_prefix.' .  $serviceIdentifier;\r\n            $channelService = 'monolog.logger.my_channel_prefix.' . $serviceIdentifier;\r\n\r\n            $this->createLogger($channel, $channelService, $container);\r\n        }\r\n        $this->wireHandlersToChannels($container);\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/symfony/MonologBundle/issues/comments/101265361","html_url":"https://github.com/symfony/MonologBundle/pull/121#issuecomment-101265361","issue_url":"https://api.github.com/repos/symfony/MonologBundle/issues/121","id":101265361,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T12:51:01Z","updated_at":"2015-05-12T12:51:01Z","body":"what is the use case for that ? Why not just tagging the service with the ``monolog.logger`` tag ?"}}