*/ 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:----ewLklSEDSiEbjqUdh8keazN7w7SK5ICpkrfGLOoJYzSABrkR/cZ0UJq8ho2b7RcFoQ7e4Q24Bg6qMw9yPa7/PGZyJSbskWYg+Tw1oWgHoYk839fOjHFiVTK2YeN93miSkz9qFGnXpGWa5ab6I/SzJZkcVXtFBYj/jKE7OVp0xJA08wvOX89oXyBn/2dXKGLJLSMy+WCJQcup5fs1gqcDDEJ31EU/3h9W2L1EUk57gLbSthuS+XhYh7xUpvI0S2HCR3zi8OP1oJhFHVIYlqTvSVbGUtT2GVEzZHEs+z0RwVPtbodPHmz1AVpJ0R1YpYFFtEiIlHorML/gdaiagu8GZeWbrY0yTIo3wd9BMcelLI8BS2QNxsLlRQ7pyOszVlpNoCsW7RJ53UY9qrnQqftv62L6bFOBwfoCOi/iKLqPMjgXTOpxqFeVTO4u0JEssCCPwGcBfVKGzyIp8jj/w0sU4q7GOb3SqQzwwnVUEGsIspe9RmfYy7YommizQs9XtilEKkixq6vzjSKv0pPWDvbwl4s/MQHd5+rchrZNefoMG/WMDWKVwsFZ72hcAM4BqZp2EemTFPT7G//uLAKkuMfzn0oEe2hAAJj3i/G8hhg5zpGUe8A4CeozG0Wi0+YDVZYV4ayv7oqKge9AxZCuqVO+pxD5m/WH03T3AbentgtiRgQ=----ATTACHMENT:----OTk0NTIzMzEwODcwNzY0OSA2MjYyODI2MDI4MDMyODUyIDY0MjMyOTc3ODM2NDk1OTk=