Skip to content

[Question] Preference not working in di.xml #2720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 15, 2015 · 3 comments
Closed

[Question] Preference not working in di.xml #2720

ghost opened this issue Dec 15, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 15, 2015

Hi,

I have a custom module where I'd like to extend the Base Handler

<preference for="Magento\Framework\Logger\Handler\Base" type="Custom\Foo\Handler\DefaultHandler" />

Strangewise this does not work in this specifc case, while other preferences are working fine like

<preference for="Psr\Log\LoggerInterface" type="Custom\BarFoo\Handler\BaseLog" />

Thanks for clarification

Best

@Vinai Vinai added the forum label Dec 15, 2015
@Vinai
Copy link
Contributor

Vinai commented Dec 15, 2015

See #2674 for an explanation of why it isn't working.

Also, the GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or Magento Stack Exchange site for technical questions. In your case, the programming questions forum is likely the most appropriate.
Feel free to reopen this issue if you think you have encountered a bug in Magento 2.

@Vinai Vinai closed this as completed Dec 15, 2015
@ghost
Copy link
Author

ghost commented Dec 15, 2015

Hi Vinai,

thans for the response. I was not sure if this was a bug, thats why I flagged it with question, but the reference you send is exactly what I was looking for

Thanks a lot

@Vinai
Copy link
Contributor

Vinai commented Dec 15, 2015

In future it probably would be best to first ask in the forums or on stackexchange, and then, should it look like it actually is a bug, to open an issue here on github.
I'm aware that currently this process has not yet been established, but we have been asked to help to get there as best as we can.
All the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant