* * @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:----EMvKI8y3enay9jE6pxZTyQp9lZq2EQh14xsjkNE13qYtFnXxgC1xk6/OGIx9FGTAd1MzjCwxAZD2NX8tHCFfRV5fMWWdghbHDcKXZRUYkvkF+rA7006Ss6Hozg4VvE0GytRtXhyhTZALx8UtlPuxaeQSQOqvOglSm8QEVJhvYBF95JuFiYBq1yINrTp/afbEgXmbuUeyj82uwsSPxhYVflytF6WR3c7+dcLGOCIi+Ks0tfqnz4ykFHAO9rOUKfn3TEufeI7pbwxOXZGwdq1KrTtDmQSA5xZXhkbvnm6LnFfsd0F54Uprxyj7FLMgrFmt1yCdqvMTCmIdbWXK0BEzu2W2TuESUYLwVVE2wyagDUMX8Oqi4cIIPS3gyOrRaYgWrBcAHA2OzjwAyCB4MiUAK4Onv+Uzgh+j3bXcF+utsB2DjMkBFAO6LB6HNwJKfsJhuqhE65YdLEwAtNUxPpewFC7zdSFnv9vjbu3E7VgscBxMqIhEaennomJfEwO0qFzSNohIWM5CLZSDAh73UhjbI7MY29JkpLbzSNan8/mlXfOyv68EzQ2/eSmcTDmYAenSQ8IaBVqf+7GuLJelzltrR7VDi5oU7h/WyDbNFft6NNIyhEg8X8ZMtLb90Ga8OvgQ6eD85aRNu5SVgE5UylGfTo2XMM4xyhYwiE9tbwjEEfk=----ATTACHMENT:----NTAyNjI5MzYwNDEzMDYxNCA5NDQ4MjYzOTExNTI5MzYxIDczNTE5MDY5NzY0NDUwMg==