Skip to content
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

Autoconfigure resettable processors with the kernel.reset tag #361

Closed
alexandre-abrioux opened this issue Sep 18, 2020 · 2 comments · Fixed by #368
Closed

Autoconfigure resettable processors with the kernel.reset tag #361

alexandre-abrioux opened this issue Sep 18, 2020 · 2 comments · Fixed by #368

Comments

@alexandre-abrioux
Copy link
Contributor

Hi,

As of writing this, handlers implementing the monolog ResettableInterface are correctly configured with the Symfony kernel.reset service tag.

See here:

if (!in_array($handlerId, $this->nestedHandlers) && is_subclass_of($handlerClass, ResettableInterface::class)) {
$definition->addTag('kernel.reset', ['method' => 'reset']);
}

I suggest we should do the same thing for processors implementing the monolog ResettableInterface.

It could be handy for the auto-configuration of the UidProcessor for instance: https://github.com/Seldaek/monolog/blob/master/src/Monolog/Processor/UidProcessor.php

If it is something that you would be interested in I could write a PR, I'm just asking for your opinion about that idea first :)

Thank you!

@lyrixx
Copy link
Member

lyrixx commented Oct 2, 2020

Hello @alexandre-abrioux

This is a very good idea. I'll be happy to merge your PR 👍🏼

@alexandre-abrioux
Copy link
Contributor Author

Hello @lyrixx , thank you for your answer!

I added a PR: #368

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

Successfully merging a pull request may close this issue.

2 participants