ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
InsightOpsHandler.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of the Monolog package.
5 *
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Monolog\Handler;
13
15
23{
27 protected $logToken;
28
38 public function __construct($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true)
39 {
40 if ($useSSL && !extension_loaded('openssl')) {
41 throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
42 }
43
44 $endpoint = $useSSL
45 ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443'
46 : $region . '.data.logs.insight.rapid7.com:80';
47
48 parent::__construct($endpoint, $level, $bubble);
49 $this->logToken = $token;
50 }
51
58 protected function generateDataStream($record)
59 {
60 return $this->logToken . ' ' . $record['formatted'];
61 }
62}
$endpoint
An exception for terminatinating execution or to throw for unit testing.
Inspired on LogEntriesHandler.
__construct($token, $region='us', $useSSL=true, $level=Logger::DEBUG, $bubble=true)
Exception can be thrown if an extension for an handler is missing.
Stores to any socket - uses fsockopen() or pfsockopen().
Monolog log channel.
Definition: Logger.php:29
const DEBUG
Detailed debug information.
Definition: Logger.php:33