-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Monolog] Use a standalone http client for ElasticsearchLogstashHandler #34423
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
Conversation
This mean the logger will not be injected in this Handler, and it will prevent an infinite loop : a log > ElasticsearchLogstashHandler > fire an HTTP request > the http request emits another log > ...
2e400b5
to
6fc6263
Compare
I really think this should be on monolog-bundle. I don't think any of the objections are real blockers. |
@@ -446,6 +448,11 @@ public function load(array $configs, ContainerBuilder $container) | |||
$container->registerForAutoconfiguration(LoggerAwareInterface::class) | |||
->addMethodCall('setLogger', [new Reference('logger')]); | |||
|
|||
$handlerAutoconfiguration = $container->registerForAutoconfiguration(ElasticsearchLogstashHandler::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would bind on HandlerInterface instead - all handlers that need an http_client
cannot use the default one since it logs.
May I ask why? What's the issue with putting the code here? |
4.4 is closed for new feats, and what is configured here is the responsibility of the monolog-bundle :) |
This is not a feature, it's a bug fix :) |
Closing in favor of symfony/monolog-bundle#331 |
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
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
This mean the logger will not be injected in this Handler, and it will
prevent an infinite loop :
a log > ElasticsearchLogstashHandler > fire an HTTP request > the http
request emits another log > ...
I did not submit this patch on monolog-bundle because: