Skip to content

Commit

Permalink
Use clientbuilder factory for ES client, refs #438
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed May 10, 2022
1 parent f5b44f1 commit 769b7da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DependencyInjection/MonologExtension.php
Expand Up @@ -316,6 +316,8 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
if ($handler['type'] === 'elastic_search') {
// v8 has a new Elastic\ prefix
$client = new Definition(class_exists('Elastic\Elasticsearch\Client') ? 'Elastic\Elasticsearch\Client' : 'Elasticsearch\Client');
$factory = class_exists('Elastic\Elasticsearch\ClientBuilder') ? 'Elastic\Elasticsearch\ClientBuilder' : 'Elasticsearch\ClientBuilder');
$client->setFactory([$factory, 'fromConfig']);
$clientArguments = [
'host' => $handler['elasticsearch']['host'],
];
Expand Down

0 comments on commit 769b7da

Please sign in to comment.