{"action":"closed","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/7684","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/7684/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/7684/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/7684/events","html_url":"https://github.com/magento/magento2/issues/7684","id":193545751,"number":7684,"title":"Unable to inject custom Logger into Helper that extends AbstractHelper","user":{"login":"craigcarnell","id":1188869,"avatar_url":"https://avatars.githubusercontent.com/u/1188869?v=3","gravatar_id":"","url":"https://api.github.com/users/craigcarnell","html_url":"https://github.com/craigcarnell","followers_url":"https://api.github.com/users/craigcarnell/followers","following_url":"https://api.github.com/users/craigcarnell/following{/other_user}","gists_url":"https://api.github.com/users/craigcarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/craigcarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigcarnell/subscriptions","organizations_url":"https://api.github.com/users/craigcarnell/orgs","repos_url":"https://api.github.com/users/craigcarnell/repos","events_url":"https://api.github.com/users/craigcarnell/events{/privacy}","received_events_url":"https://api.github.com/users/craigcarnell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-05T16:32:05Z","updated_at":"2016-12-09T09:12:05Z","closed_at":"2016-12-09T09:12:05Z","body":"### Preconditions\r\n1. Magento 2.1.2\r\n2. PHP 7.x.x\r\n\r\n### Steps to reproduce\r\n1. In di.xml of module\r\n```\r\n<type name=\"VaxLtd\\ExactTarget\\Model\\Subscriber\\NewSubscriber\">\r\n        <arguments>\r\n            <argument name=\"logger\" xsi:type=\"object\">VaxLtd\\ExactTarget\\Model\\Logger\\NewsletterExport</argument>\r\n        </arguments>\r\n    </type>\r\n```\r\n\r\nIn Helper class:\r\n```\r\npublic function __construct(\r\n        \\Magento\\Framework\\App\\Helper\\Context $context,\r\n        \\Psr\\Log\\LoggerInterface $logger\r\n    ) {\r\n        parent::__construct($context);\r\n        $this->_logger = $logger;\r\n    }\r\n```\r\n\r\nCustom Log location:\r\n```\r\n<?php\r\nnamespace VaxLtd\\ExactTarget\\Model\\Logger\\Handler;\r\n\r\nuse Magento\\Framework\\Logger\\Handler\\System;\r\n\r\nclass NewsletterExport extends System\r\n{\r\n    protected $fileName = '/var/log/newsletter_export.log';\r\n}\r\n\r\n```\r\n\r\n2. run bin/magento setup:di:compile\r\n\r\n### Expected result\r\n1. It should allow you to replace the logger\r\n2. It's possible to remove $logger from constructor and use $content->getLogger() however you can no longer inject your custom fileName\r\n\r\n### Actual result\r\n```\r\nErrors during compilation:\r\n\tVaxLtd\\ExactTarget\\Helper\\Data\r\n\t\tIncorrect dependency in class VaxLtd\\ExactTarget\\Helper\\Data in /Users/ccarnell/Sites/vax-uk2/vendor/vaxltd/module-exact-target/Helper/Data.php\r\n\\Psr\\Log\\LoggerInterface already exists in context object\r\nTotal Errors Count: 1\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"craigcarnell"}}