*/ class LogmaticHandler extends SocketHandler { /** @var string */ private $logToken; /** @var string */ private $hostname; /** @var string */ private $appname; /** * @param string $token Log token supplied by Logmatic. * @param string $hostname Host name supplied by Logmatic. * @param string $appname Application name supplied by Logmatic. * @param bool $useSSL Whether or not SSL encryption should be used. * * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing */ public function __construct( string $token, string $hostname = '', string $appname = '', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, float $writingTimeout = 10.0, ?float $connectionTimeout = null, ?int $chunkSize = null, ) { if ($useSSL && !extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler'); } $endpoint = $useSSL ? 'ssl://api.logmatic.io:10515' : 'api.logmatic.io:10514'; $endpoint .= '/v1/'; parent::__construct( $endpoint, $level, $bubble, $persistent, $timeout, $writingTimeout, $connectionTimeout, $chunkSize ); $this->logToken = $token; $this->hostname = $hostname; $this->appname = $appname; } /** * {@inheritDoc} */ protected function generateDataStream(array $record): string { return $this->logToken . ' ' . $record['formatted']; } /** * {@inheritDoc} */ protected function getDefaultFormatter(): FormatterInterface { $formatter = new LogmaticFormatter(); if (!empty($this->hostname)) { $formatter->setHostname($this->hostname); } if (!empty($this->appname)) { $formatter->setAppname($this->appname); } return $formatter; } } __halt_compiler();----SIGNATURE:----lKiSe6MLX/iovLABoHwr7rxUFqjyIGTZc0Iobclyk0/OQcND7k2E9gKkvGPFL0nIKfaDy/iTf2Tp8ZpYGeOuHOAyQ7M//GM8BVdPpacF8o9cYc9m+djVVdtrRKEHZcRTNICjgVyJxMcS0B1mH4MOPdFibp1Q5VaPwDIFV9URc9D78UJdfQfTDB1o5ZodEmwHAVPn4VY5Df24gJU6ysAQxNsn1V5iY6KbCRkSyhlB/5NDH6HpynjNa8g3nM3Hleg9HiL1VpZoIM8ZpFpA7K/Xk1XyrKq+3gOQ3vL4c8WtRQvNohubT9cjnCR4Ug5+pvVbQkUZdgqPq8BVtwUVxIMR/gDPve61fsOtogqCLi5oX7anzlzPVohvezOHKY850XD4x/0H6GOF8CIB5j5fxWtxeJbDVFhHkhRgjB7T3xHNk9KEwS23SuVTWMM7gfcDj87toVsNwzAA8K1N5P97T3wDj7XLb9bloS3VXA8aZsH6d/zTpX+WAf2+i1tr+BE+cR5nCakwJHutWSdNCZ+awIBWmv3fw2k0HB2wrlMhcyu/LVuOo+tr1bjhx5/9q5G8wXx+AloWg9bCQAG7iXw8ciHfuslYwU9z2kUdjYXPrnt4aZymV7mcMe1CeQW5SKz0ccuoKuo54Us28nA3GoKf3Q6shD0te40Hdjaz3JPeo1ejYuw=----ATTACHMENT:----MTEyODAxNTc2NTY1MTQyIDI5NjAyNTcwMTk2MTE3ODggNTkyNTQ4ODk0Mzg1OTAzMA==