CodeExplorer sendToElasticsearch example
$this->client =
$client ?: HttpClient::
create(['timeout' => 1
]);
$this->responses =
new \
SplObjectStorage();
$this->elasticsearchVersion =
$elasticsearchVersion;
} private function doHandle(array|LogRecord
$record): bool
{ if (!
$this->
isHandling($record)) { return false;
} $this->
sendToElasticsearch([$record]);
return !
$this->bubble;
} public function handleBatch(array
$records): void
{ $records =
array_filter($records,
$this->
isHandling(...
));
if ($records) { $this->
sendToElasticsearch($records);
} }