diff --git a/CHANGELOG.md b/CHANGELOG.md index 34228c55..4a30a4e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Add TelegramBotHandler `topic` support * Deprecate `sentry` and `raven` handler, use a `service` handler with [`sentry/sentry-symfony`](https://docs.sentry.io/platforms/php/guides/symfony/logs/) instead * Add configuration for Gelf encoders +* Fix `host` configuration for `elastic_search` handler ## 3.10.0 (2023-11-06) diff --git a/src/DependencyInjection/MonologExtension.php b/src/DependencyInjection/MonologExtension.php index 2f45d218..e6629142 100644 --- a/src/DependencyInjection/MonologExtension.php +++ b/src/DependencyInjection/MonologExtension.php @@ -304,7 +304,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler $factory = class_exists('Elastic\Elasticsearch\ClientBuilder') ? 'Elastic\Elasticsearch\ClientBuilder' : 'Elasticsearch\ClientBuilder'; $client->setFactory([$factory, 'fromConfig']); $clientArguments = [ - 'host' => $handler['elasticsearch']['host'], + 'hosts' => [$handler['elasticsearch']['host']], ]; if (isset($handler['elasticsearch']['user'], $handler['elasticsearch']['password'])) {