Skip to content

[Monolog] Do not autowire the ElasticsearchLogstashHandler service #12642

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
wants to merge 1 commit into from

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Nov 16, 2019

If so, Symfony will inject an HttpClient, and this one has a logger in it. So for each log, another log for the HTTP Client will be emitted => infinite loop => 💥

ref: symfony/symfony#32360 (comment)

If so, Symfony will inject an HttpClient, and this one has a logger in it. So for each log, another log for the HTTP Client will be emitted => infinite loop => 💥
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 16, 2019

Instead of this, I would suggest to let monolog-bundle do the same as in RegisterTokenUsageTrackingPass for all instances of Monolog\Handler\HandlerInterface:

https://github.com/symfony/symfony/blob/4ac626a4827d1fa7d37d3a08961befac97911c3d/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterTokenUsageTrackingPass.php#L39-L42

@javiereguiluz
Copy link
Member

Let's close this "temporary fix" in favor of a more permanent solution proposed in symfony/monolog-bundle#331. Thanks.

lyrixx added a commit to symfony/monolog-bundle that referenced this pull request Jan 6, 2020
This PR was merged into the 3.x-dev branch.

Discussion
----------

Use an HttpClient without logger in all handlers

fixes:

* symfony/symfony#34423
* symfony/symfony#32360 (comment)
* symfony/symfony-docs#12642

Commits
-------

faf6943 Use an HttpClient without logger in all handlers
@lyrixx lyrixx deleted the patch-1 branch January 6, 2020 10:35
dani-danigm pushed a commit to dani-danigm/monolog-bundle that referenced this pull request Jun 15, 2022
This PR was merged into the 3.x-dev branch.

Discussion
----------

Use an HttpClient without logger in all handlers

fixes:

* symfony/symfony#34423
* symfony/symfony#32360 (comment)
* symfony/symfony-docs#12642

Commits
-------

2abc6f6 Use an HttpClient without logger in all handlers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants