OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
monolog
/
monolog
/
src
/
Monolog
/
Handler
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:58 AM
rwxr-xr-x
📄
AbstractHandler.php
2.71 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
AbstractProcessingHandler.php
1.52 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
AbstractSyslogHandler.php
3.24 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
AmqpHandler.php
5.12 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
BrowserConsoleHandler.php
9.3 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
BufferHandler.php
4.6 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
ChromePHPHandler.php
5.21 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
CouchDBHandler.php
2.64 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
CubeHandler.php
5.48 KB
08/12/2024 10:35:56 AM
rw-r--r--
📁
Curl
-
08/12/2024 10:36:32 AM
rwxr-xr-x
📄
DeduplicationHandler.php
6.42 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
DoctrineCouchDBHandler.php
1.17 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
DynamoDbHandler.php
1.97 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
ElasticaHandler.php
3.72 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
ElasticsearchHandler.php
7.01 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
ErrorLogHandler.php
2.71 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
FallbackGroupHandler.php
1.75 KB
08/12/2024 10:35:56 AM
rw-r--r--
📄
FilterHandler.php
7.12 KB
08/12/2024 10:35:57 AM
rw-r--r--
📁
FingersCrossed
-
08/12/2024 10:36:32 AM
rwxr-xr-x
📄
FingersCrossedHandler.php
8.21 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
FirePHPHandler.php
5.2 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
FleepHookHandler.php
3.57 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
FlowdockHandler.php
3.52 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
FormattableHandlerInterface.php
791 bytes
08/12/2024 10:35:57 AM
rw-r--r--
📄
FormattableHandlerTrait.php
1.29 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
GelfHandler.php
1.48 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
GroupHandler.php
3.32 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
Handler.php
1.27 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
HandlerInterface.php
2.79 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
HandlerWrapper.php
3.41 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
IFTTTHandler.php
2.29 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
InsightOpsHandler.php
2.11 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
LogEntriesHandler.php
1.93 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
LogglyHandler.php
4.17 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
LogmaticHandler.php
2.67 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
MailHandler.php
2.28 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
MandrillHandler.php
2.56 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
MissingExtensionException.php
494 bytes
08/12/2024 10:35:57 AM
rw-r--r--
📄
MongoDBHandler.php
2.39 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
NativeMailerHandler.php
5.05 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
NewRelicHandler.php
5.88 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
NoopHandler.php
950 bytes
08/12/2024 10:35:57 AM
rw-r--r--
📄
NullHandler.php
1.35 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
OverflowHandler.php
4.35 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
PHPConsoleHandler.php
12.22 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
ProcessHandler.php
5.24 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
ProcessableHandlerInterface.php
1.2 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
ProcessableHandlerTrait.php
1.65 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
PsrHandler.php
2.5 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
PushoverHandler.php
8.16 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
RedisHandler.php
2.76 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
RedisPubSubHandler.php
1.71 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
RollbarHandler.php
3.65 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
RotatingFileHandler.php
7.02 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SamplingHandler.php
3.94 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SendGridHandler.php
2.97 KB
08/12/2024 10:35:57 AM
rw-r--r--
📁
Slack
-
08/12/2024 10:36:32 AM
rwxr-xr-x
📄
SlackHandler.php
7.25 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SlackWebhookHandler.php
3.92 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SocketHandler.php
12.27 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SqsHandler.php
1.77 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
StreamHandler.php
6.83 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SymfonyMailerHandler.php
3.55 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
SyslogHandler.php
1.71 KB
08/12/2024 10:35:57 AM
rw-r--r--
📁
SyslogUdp
-
08/12/2024 10:36:32 AM
rwxr-xr-x
📄
SyslogUdpHandler.php
4.78 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
TelegramBotHandler.php
9.51 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
TestHandler.php
6.51 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
WebRequestRecognizerTrait.php
527 bytes
08/12/2024 10:35:57 AM
rw-r--r--
📄
WhatFailureGroupHandler.php
1.94 KB
08/12/2024 10:35:57 AM
rw-r--r--
📄
ZendMonitorHandler.php
2.87 KB
08/12/2024 10:35:57 AM
rw-r--r--
Editing: SendGridHandler.php
Close
<?php declare(strict_types=1); /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Monolog\Level; /** * SendGridrHandler uses the SendGrid API v2 function to send Log emails, more information in https://sendgrid.com/docs/API_Reference/Web_API/mail.html * * @author Ricardo Fontanelli <ricardo.fontanelli@hotmail.com> */ class SendGridHandler extends MailHandler { /** * The SendGrid API User */ protected string $apiUser; /** * The SendGrid API Key */ protected string $apiKey; /** * The email addresses to which the message will be sent */ protected string $from; /** * The email addresses to which the message will be sent * @var string[] */ protected array $to; /** * The subject of the email */ protected string $subject; /** * @param string $apiUser The SendGrid API User * @param string $apiKey The SendGrid API Key * @param string $from The sender of the email * @param string|string[] $to The recipients of the email * @param string $subject The subject of the mail * * @throws MissingExtensionException If the curl extension is missing */ public function __construct(string $apiUser, string $apiKey, string $from, string|array $to, string $subject, int|string|Level $level = Level::Error, bool $bubble = true) { if (!\extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the SendGridHandler'); } parent::__construct($level, $bubble); $this->apiUser = $apiUser; $this->apiKey = $apiKey; $this->from = $from; $this->to = (array) $to; $this->subject = $subject; } /** * @inheritDoc */ protected function send(string $content, array $records): void { $message = []; $message['api_user'] = $this->apiUser; $message['api_key'] = $this->apiKey; $message['from'] = $this->from; foreach ($this->to as $recipient) { $message['to[]'] = $recipient; } $message['subject'] = $this->subject; $message['date'] = date('r'); if ($this->isHtmlBody($content)) { $message['html'] = $content; } else { $message['text'] = $content; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.sendgrid.com/api/mail.send.json'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($message)); Curl\Util::execute($ch, 2); } }