mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-29 16:00:27 +02:00
Elastica up to 7 support
This commit is contained in:
@@ -58,6 +58,9 @@ class ElasticaFormatter extends NormalizerFormatter
|
||||
return $this->index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since Elastica 7 type has no effect
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
@@ -72,7 +75,9 @@ class ElasticaFormatter extends NormalizerFormatter
|
||||
{
|
||||
$document = new Document();
|
||||
$document->setData($record);
|
||||
$document->setType($this->type);
|
||||
if(method_exists($document, 'setType')) {
|
||||
$document->setType($this->type);
|
||||
}
|
||||
$document->setIndex($this->index);
|
||||
|
||||
return $document;
|
||||
|
@@ -25,7 +25,7 @@ use Elastica\Exception\ExceptionInterface;
|
||||
* $client = new \Elastica\Client();
|
||||
* $options = array(
|
||||
* 'index' => 'elastic_index_name',
|
||||
* 'type' => 'elastic_doc_type',
|
||||
* 'type' => 'elastic_doc_type', Types have been removed in Elastica 7
|
||||
* );
|
||||
* $handler = new ElasticaHandler($client, $options);
|
||||
* $log = new Logger('application');
|
||||
|
Reference in New Issue
Block a user