*/ 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:----UGlGY5Vs0FfrV6+6JU09iZYxYC2bIMmkigdrPLhSiouwX22upJ73Fctc15G3aF5piLtp1pLP6urQJRUsZ12aJmbaRVhEHmIcII9MXxdkrWVpurWy4ZgL6TdJuZg95lTuaNkG+PxOSXNGnCItAnX2Dy4/xe338B4gncHEf57f/+SsCagmrLQAyHpzFlPAqJPBdkoasoAk09NuFZ5UqePF6g1qIfIIfDWJi2L8FzUn1ADS3lyRXLST3CG4/YamhPYk2HBaHlmVcSQtJlt3kjg+6VIbQlWrryW9c6SZeS6rTfMBU1OEB4AxdlUlyp120cyFqagZPdheWmlvwRFR8qpEXUVgr8orzl+GnYt0eB3XUT3mI4rHCjD12jdPWEVkbudFmA6LF4DjO4b8mqD6XheQIucCcfFfJT8Ith8w/01nfd2qedGbonzbjzMqMdcmNtMD4y1VTSum1ID4rjUKHVQZybmO0hAC9biLI2zC3rsgkzhiYczjI40LW9b46jOwohILtTRU35pguJ5XGuBDuICgnjqotIFCJSqPEb802B+hc5TPMMNublrdK8AgxrU4JSkv8dwro0vlmu1IzOvwfn04ydN0DtOHLUln4tbKDtqLsCwtCNLgSGA8/qcKMFYMEjpmj8L1eP0BEt1B0izGlE6HVNe+rld9vcsCu7bAXG6ujX4=----ATTACHMENT:----NTg1Mzg4MDQxMDI0MTY2IDQyODAzMTgxNTI4ODQ1OCAxOTQ2OTYyMTQ1NjI4NzM=