setTracer example

'client' => [
                    'curl' => [
                        CURLOPT_HTTPHEADER => [
                            'Content-type: application/json',
                        ],
                    ],
                ],
            ]
        );

        $clientBuilder->setLogger($eslogger);
        $clientBuilder->setTracer($eslogger);

        /** @var EsClientLogger $esClient */
        $esClient = $clientBuilder->build();

        $esClient->setLogger($eslogger);
        $esClient->setEvaluation($evaluationHelper);

        return $esClient;
    }
}
/** * @param array{verify_server_cert: bool, cert_path?: string, cert_key_path?: string} $sslConfig */
    public static function createClient(string $hosts, LoggerInterface $logger, bool $debug, array $sslConfig): Client
    {
        $hosts = array_filter(explode(',', $hosts));

        $clientBuilder = ClientBuilder::create();
        $clientBuilder->setHosts($hosts);

        if ($debug) {
            $clientBuilder->setTracer($logger);
        }

        $clientBuilder->setLogger($logger);

        if ($sslConfig['verify_server_cert'] === false) {
            $clientBuilder->setSSLVerification(false);
        }

        if (isset($sslConfig['cert_path'])) {
            $clientBuilder->setSSLCert($sslConfig['cert_path']$sslConfig['cert_password'] ?? null);
        }

        
Home | Imprint | This part of the site doesn't use cookies.