in src/OpenSearch/Connections/Connection.php [434:468]
public function logRequestFail(array $request, array $response, \Exception $exception): void
{
$port = $request['client']['curl'][CURLOPT_PORT] ?? $response['transfer_stats']['primary_port'] ?? '';
$uri = $this->addPortInUrl($response['effective_url'], (int) $port);
$this->log->debug('Request Body', array($request['body']));
$this->log->warning(
'Request Failure:',
array(
'method' => $request['http_method'],
'uri' => $uri,
'port' => $port,
'headers' => $request['headers'],
'HTTP code' => $response['status'],
'duration' => $response['transfer_stats']['total_time'],
'error' => $exception->getMessage(),
)
);
$this->log->warning('Response', array($response['body']));
// Build the curl command for Trace.
$curlCommand = $this->buildCurlCommand($request['http_method'], $uri, $request['body']);
$this->trace->info($curlCommand);
$this->trace->debug(
'Response:',
array(
'response' => $response,
'method' => $request['http_method'],
'uri' => $uri,
'port' => $port,
'HTTP code' => $response['status'],
'duration' => $response['transfer_stats']['total_time'],
)
);
}