* @author Gabriel Machado */ class InsightOpsHandler extends SocketHandler { /** @var string */ protected $logToken; /** * @param string $token Log token supplied by InsightOps * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. * @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 $region = 'us', 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 plugin is required to use SSL encrypted connection for InsightOpsHandler'); } $endpoint = $useSSL ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' : $region . '.data.logs.insight.rapid7.com:80'; parent::__construct( $endpoint, $level, $bubble, $persistent, $timeout, $writingTimeout, $connectionTimeout, $chunkSize ); $this->logToken = $token; } /** * {@inheritDoc} */ protected function generateDataStream(array $record): string { return $this->logToken . ' ' . $record['formatted']; } } __halt_compiler();----SIGNATURE:----MDe0dLJjoCgfqrEfAXECt+kfSxs1hrqfFQIV6MqDeIdq59/eI5x90C7eLKsRul+1jXA3NZj6PcAYc/TmfTKinck01D5uqO6bExe0sAKtMfL2tQX0I0YTjbiZbHW4lMBtre2JH46rzRldpnlqWa9ky3abf/AvaocxXzIqInphFFUnF1NxA5kwLB7/2WfCxngHZ5S8IUcfkTN5qlQAUo3EiNyNj2q9qntv9cP3W8fOffgEodL362vVvvz8iLCIspN5cC4znq1C6kK25+76IiN+KynqNSa6NNvJCUhfpofafLbR726+ppxDE4TyK76PEEQq8bQoRHtd7hljzqLq1BTu8k3EA7Xj4Sezg4jGYHNBrdkylVussXkJZ73ETfL9obYECEr5Aqf/1JwEuPOJCYnj8ZL1CUbn6oAU1Euc6lS0uq84e4RGJBi4ZKsvAejr7RDJtppOq5SWmUsiJZTOL5sbPINhPIa4m6qKaitfxdwpuIsAttu0yhoowxctitq0GB+n5XpY6TRIGYh/+oHwBOCydAtG0UlWg+XcMXrEdCwSjMmMydCFOY6u7QMn8JhLTw5LFwGB+pLyoAIwIQsMFM166kL1Mlksz8wUF0i9XlsCj64KpjfQQk+QHtZgPhclPqMd7hPMBg1BLzxMdHxnl1lX4xgMEJ7glfNXr0x91IMRVxA=----ATTACHMENT:----NDIwMTYxMTk1NzQ3NDYzMiA5MzY1MjA2NzUyOTUxNzYyIDgyMzA5ODQ4NjgxMjEzMg==