* * @phpstan-import-type Record from \Monolog\Logger */ class ElasticaFormatter extends NormalizerFormatter { /** @var string Elastic search index name */ protected $index; /** @var ?string Elastic search document type */ protected $type; /** * @param string $index Elastic Search index name * @param ?string $type Elastic Search document type, deprecated as of Elastica 7 */ public function __construct(string $index, ?string $type) { // elasticsearch requires a ISO 8601 format date with optional millisecond precision. parent::__construct('Y-m-d\TH:i:s.uP'); $this->index = $index; $this->type = $type; } /** * {@inheritDoc} */ public function format(array $record) { $record = parent::format($record); return $this->getDocument($record); } public function getIndex(): string { return $this->index; } /** * @deprecated since Elastica 7 type has no effect */ public function getType(): string { /** @phpstan-ignore-next-line */ return $this->type; } /** * Convert a log message into an Elastica Document * * @phpstan-param Record $record */ protected function getDocument(array $record): Document { $document = new Document(); $document->setData($record); if (method_exists($document, 'setType')) { /** @phpstan-ignore-next-line */ $document->setType($this->type); } $document->setIndex($this->index); return $document; } } __halt_compiler();----SIGNATURE:----qpHdBGizowxzTEw+pjMnXrF6Ooh6xtxBIPQYo99OTni1lAPkjLpnse2CiI+Xy/wih5KRTTOEVjmNlQWKj05Ya718S6mnql5KJq+07pdsL/mglsUApOJRAn1mEAtvQIp+eDvjNTtO2Q2K+UdoFmcyBO5FVYw41D/HoWD/VSQPlNCR7RoOoIBW5N3FW1GRHGAsGfJfgRjCK9jxiN25wXf0K9NET16o5Drd7GbxGMPOXrBtQvN2uRDI+fWMQDXVRb2oE+0PuEkEZ8lIUc11GVK5hrGRkgsN54Oz2/baLxXtjbMU40Tm9Xt3rPRZInhs6/zkontZDBulf4tiRh4VoyQTcoEfaQFl3zy5kdruLq3tRurOxfmxB93PfmlTF2qN+AeU0+dcSUD91gcfI3vqcn1QIP9aTj/GBmL50xiiWxy7m35dgRT3kBPfyobhR//rb8NJGpusOx4ZIMj81WnPDO0fCbIdRweXg+h44kozjkwVjyyE/ebu1NdXULdiAgVkduPiQfesURK/3pPvfmLV+12xrBzgk9Wd7j+4s++t/j/f+/+wdt/oLCn0T2dCG8rd8eXAUw/dOlNwuxa6vZ5QsLsJm+RnbMc6PLNijSFCdzpwgUY293UMKPABZRqzXWFAwabmc1GSw0fze1EpEkmFHMI/diQ19pr1pmhMAzds6uWTmfg=----ATTACHMENT:----NjA1NDUwMDAzMzM4NTgzNiA5NDIxMzY0OTEzMjc3NDQ3IDQ0NDQ0ODU1OTU3MTY4Nzc=