Skip to content

Commit b950e76

Browse files
committed
[MonologBridge] Improve error when HttpClient contract is installed but not the component
1 parent 71f6327 commit b950e76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Handler/ElasticsearchLogstashHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ElasticsearchLogstashHandler extends AbstractHandler
6363

6464
public function __construct(string $endpoint = 'http://127.0.0.1:9200', string $index = 'monolog', ?HttpClientInterface $client = null, string|int|Level $level = Logger::DEBUG, bool $bubble = true, string $elasticsearchVersion = '1.0.0')
6565
{
66-
if (!interface_exists(HttpClientInterface::class)) {
66+
if (!$client && !class_exists(HttpClient::class)) {
6767
throw new \LogicException(\sprintf('The "%s" handler needs an HTTP client. Try running "composer require symfony/http-client".', __CLASS__));
6868
}
6969

0 commit comments

Comments
 (0)