/home/techb158/ileadtechnology.com/SSM/vendor/monolog/monolog/src/Monolog/Handler
NameSizeModeActions
Curl/-0755rm
FingersCrossed/-0755rm
Slack/-0755rm
SyslogUdp/-0755rm
AbstractHandler.php22870644editdlrm
AbstractProcessingHandler.php14330644editdlrm
AbstractSyslogHandler.php35840644editdlrm
AmqpHandler.php40380644editdlrm
BrowserConsoleHandler.php76220644editdlrm
BufferHandler.php42010644editdlrm
ChromePHPHandler.php52050644editdlrm
CouchDBHandler.php20320644editdlrm
CubeHandler.php48490644editdlrm
DeduplicationHandler.php56950644editdlrm
DoctrineCouchDBHandler.php10980644editdlrm
DynamoDbHandler.php23740644editdlrm
ElasticaHandler.php33850644editdlrm
ElasticsearchHandler.php54700644editdlrm
ErrorLogHandler.php25120644editdlrm
FallbackGroupHandler.php13840644editdlrm
FilterHandler.php53710644editdlrm
FingersCrossedHandler.php71120644editdlrm
FirePHPHandler.php48970644editdlrm
FleepHookHandler.php33190644editdlrm
FlowdockHandler.php32540644editdlrm
FormattableHandlerInterface.php8450644editdlrm
FormattableHandlerTrait.php13200644editdlrm
GelfHandler.php16220644editdlrm
GroupHandler.php29570644editdlrm
Handler.php10290644editdlrm
HandlerInterface.php27780644editdlrm
HandlerWrapper.php33380644editdlrm
IFTTTHandler.php21950644editdlrm
InsightOpsHandler.php18950644editdlrm
LogEntriesHandler.php17140644editdlrm
LogglyHandler.php41860644editdlrm
LogmaticHandler.php25020644editdlrm
MailHandler.php20660644editdlrm
MandrillHandler.php24860644editdlrm
MissingExtensionException.php4730644editdlrm
MongoDBHandler.php26720644editdlrm
NativeMailerHandler.php51650644editdlrm
NewRelicHandler.php63660644editdlrm
NoopHandler.php8800644editdlrm
NullHandler.php11420644editdlrm
OverflowHandler.php44260644editdlrm
PHPConsoleHandler.php102680644editdlrm
ProcessableHandlerInterface.php9480644editdlrm
ProcessableHandlerTrait.php15340644editdlrm
ProcessHandler.php54230644editdlrm
PsrHandler.php26510644editdlrm
PushoverHandler.php70250644editdlrm
RedisHandler.php30050644editdlrm
RollbarHandler.php35500644editdlrm
RotatingFileHandler.php61410644editdlrm
SamplingHandler.php34230644editdlrm
SendGridHandler.php29040644editdlrm
SlackHandler.php66680644editdlrm
SlackWebhookHandler.php40290644editdlrm
SocketHandler.php99210644editdlrm
SqsHandler.php17830644editdlrm
StreamHandler.php53700644editdlrm
SwiftMailerHandler.php31950644editdlrm
SyslogHandler.php20030644editdlrm
SyslogUdpHandler.php35810644editdlrm
TelegramBotHandler.php27800644editdlrm
TestHandler.php56840644editdlrm
WebRequestRecognizerTrait.php5240644editdlrm
WhatFailureGroupHandler.php15330644editdlrm
ZendMonitorHandler.php31730644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php (4186B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Monolog\Logger; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogglyFormatter; use function array_key_exists; /** * Sends errors to Loggly. * * @author Przemek Sobstel * @author Adam Pancutt * @author Gregory Barchard */ class LogglyHandler extends AbstractProcessingHandler { protected const HOST = 'logs-01.loggly.com'; protected const ENDPOINT_SINGLE = 'inputs'; protected const ENDPOINT_BATCH = 'bulk'; /** * Caches the curl handlers for every given endpoint. * * @var array */ protected $curlHandlers = []; protected $token; protected $tag = []; /** * @param string $token API token supplied by Loggly * @param string|int $level The minimum logging level to trigger this handler * @param bool $bubble Whether or not messages that are handled should bubble up the stack. * * @throws MissingExtensionException If the curl extension is missing */ public function __construct(string $token, $level = Logger::DEBUG, bool $bubble = true) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the LogglyHandler'); } $this->token = $token; parent::__construct($level, $bubble); } /** * Loads and returns the shared curl handler for the given endpoint. * * @param string $endpoint * * @return resource */ protected function getCurlHandler(string $endpoint) { if (!array_key_exists($endpoint, $this->curlHandlers)) { $this->curlHandlers[$endpoint] = $this->loadCurlHandler($endpoint); } return $this->curlHandlers[$endpoint]; } /** * Starts a fresh curl session for the given endpoint and returns its handler. * * @param string $endpoint * * @return resource */ private function loadCurlHandler(string $endpoint) { $url = sprintf("https://%s/%s/%s/", static::HOST, $endpoint, $this->token); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); return $ch; } /** * @param string[]|string $tag */ public function setTag($tag): self { $tag = !empty($tag) ? $tag : []; $this->tag = is_array($tag) ? $tag : [$tag]; return $this; } /** * @param string[]|string $tag */ public function addTag($tag): self { if (!empty($tag)) { $tag = is_array($tag) ? $tag : [$tag]; $this->tag = array_unique(array_merge($this->tag, $tag)); } return $this; } protected function write(array $record): void { $this->send($record["formatted"], static::ENDPOINT_SINGLE); } public function handleBatch(array $records): void { $level = $this->level; $records = array_filter($records, function ($record) use ($level) { return ($record['level'] >= $level); }); if ($records) { $this->send($this->getFormatter()->formatBatch($records), static::ENDPOINT_BATCH); } } protected function send(string $data, string $endpoint): void { $ch = $this->getCurlHandler($endpoint); $headers = ['Content-Type: application/json']; if (!empty($this->tag)) { $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); } curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); Curl\Util::execute($ch, 5, false); } protected function getDefaultFormatter(): FormatterInterface { return new LogglyFormatter(); } }