golden hour
/home/doctorbruno/.trash/google-site-kit.1/third-party/monolog/monolog/src/Monolog/Handler
⬆️ Go Up
Upload
File/Folder
Size
Actions
AbstractHandler.php
2.69 KB
Del
OK
AbstractProcessingHandler.php
1.89 KB
Del
OK
AbstractSyslogHandler.php
3.47 KB
Del
OK
AmqpHandler.php
4.86 KB
Del
OK
BrowserConsoleHandler.php
9.17 KB
Del
OK
BufferHandler.php
4.64 KB
Del
OK
ChromePHPHandler.php
5.1 KB
Del
OK
CouchDBHandler.php
1.96 KB
Del
OK
CubeHandler.php
5.29 KB
Del
OK
Curl
-
Del
OK
DeduplicationHandler.php
5.99 KB
Del
OK
DoctrineCouchDBHandler.php
1.24 KB
Del
OK
DynamoDbHandler.php
2.61 KB
Del
OK
ElasticaHandler.php
3.34 KB
Del
OK
ElasticsearchHandler.php
6.39 KB
Del
OK
ErrorLogHandler.php
2.63 KB
Del
OK
FallbackGroupHandler.php
1.75 KB
Del
OK
FilterHandler.php
6.86 KB
Del
OK
FingersCrossed
-
Del
OK
FingersCrossedHandler.php
8.46 KB
Del
OK
FirePHPHandler.php
5.15 KB
Del
OK
FleepHookHandler.php
3.42 KB
Del
OK
FlowdockHandler.php
3.5 KB
Del
OK
FormattableHandlerInterface.php
901 B
Del
OK
FormattableHandlerTrait.php
1.33 KB
Del
OK
GelfHandler.php
1.5 KB
Del
OK
GroupHandler.php
3.23 KB
Del
OK
Handler.php
1.24 KB
Del
OK
HandlerInterface.php
2.99 KB
Del
OK
HandlerWrapper.php
3.35 KB
Del
OK
IFTTTHandler.php
2.15 KB
Del
OK
InsightOpsHandler.php
1.9 KB
Del
OK
LogEntriesHandler.php
1.75 KB
Del
OK
LogglyHandler.php
4.1 KB
Del
OK
LogmaticHandler.php
2.57 KB
Del
OK
MailHandler.php
2.36 KB
Del
OK
MandrillHandler.php
2.48 KB
Del
OK
MissingExtensionException.php
502 B
Del
OK
MongoDBHandler.php
2.77 KB
Del
OK
NativeMailerHandler.php
4.92 KB
Del
OK
NewRelicHandler.php
6.14 KB
Del
OK
NoopHandler.php
910 B
Del
OK
NullHandler.php
1.39 KB
Del
OK
OverflowHandler.php
4.4 KB
Del
OK
PHPConsoleHandler.php
10.52 KB
Del
OK
ProcessHandler.php
5.07 KB
Del
OK
ProcessableHandlerInterface.php
1.22 KB
Del
OK
ProcessableHandlerTrait.php
1.77 KB
Del
OK
PsrHandler.php
2.49 KB
Del
OK
PushoverHandler.php
7.57 KB
Del
OK
RedisHandler.php
3.06 KB
Del
OK
RedisPubSubHandler.php
1.91 KB
Del
OK
RollbarHandler.php
3.26 KB
Del
OK
RotatingFileHandler.php
6.31 KB
Del
OK
SamplingHandler.php
4.29 KB
Del
OK
SendGridHandler.php
2.86 KB
Del
OK
Slack
-
Del
OK
SlackHandler.php
6.65 KB
Del
OK
SlackWebhookHandler.php
3.73 KB
Del
OK
SocketHandler.php
11.96 KB
Del
OK
SqsHandler.php
1.78 KB
Del
OK
StreamHandler.php
8.22 KB
Del
OK
SwiftMailerHandler.php
3.8 KB
Del
OK
SymfonyMailerHandler.php
3.63 KB
Del
OK
SyslogHandler.php
1.95 KB
Del
OK
SyslogUdp
-
Del
OK
SyslogUdpHandler.php
4.37 KB
Del
OK
TelegramBotHandler.php
8.08 KB
Del
OK
TestHandler.php
6.67 KB
Del
OK
WebRequestRecognizerTrait.php
553 B
Del
OK
WhatFailureGroupHandler.php
1.93 KB
Del
OK
ZendMonitorHandler.php
3.21 KB
Del
OK
Edit: SyslogUdpHandler.php
<?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 Google\Site_Kit_Dependencies\Monolog\Handler; use DateTimeInterface; use Google\Site_Kit_Dependencies\Monolog\Logger; use Google\Site_Kit_Dependencies\Monolog\Handler\SyslogUdp\UdpSocket; use Google\Site_Kit_Dependencies\Monolog\Utils; /** * A Handler for logging to a remote syslogd server. * * @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com> * @author Dominik Kukacka <dominik.kukacka@gmail.com> */ class SyslogUdpHandler extends AbstractSyslogHandler { const RFC3164 = 0; const RFC5424 = 1; const RFC5424e = 2; /** @var array<self::RFC*, string> */ private $dateFormats = array(self::RFC3164 => 'M d H:i:s', self::RFC5424 => \DateTime::RFC3339, self::RFC5424e => \DateTime::RFC3339_EXTENDED); /** @var UdpSocket */ protected $socket; /** @var string */ protected $ident; /** @var self::RFC* */ protected $rfc; /** * @param string $host Either IP/hostname or a path to a unix socket (port must be 0 then) * @param int $port Port number, or 0 if $host is a unix socket * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param string $ident Program name or tag for each log message. * @param int $rfc RFC to format the message for. * @throws MissingExtensionException * * @phpstan-param self::RFC* $rfc */ public function __construct(string $host, int $port = 514, $facility = \LOG_USER, $level = Logger::DEBUG, bool $bubble = \true, string $ident = 'php', int $rfc = self::RFC5424) { if (!extension_loaded('sockets')) { throw new MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler'); } parent::__construct($facility, $level, $bubble); $this->ident = $ident; $this->rfc = $rfc; $this->socket = new UdpSocket($host, $port); } protected function write(array $record): void { $lines = $this->splitMessageIntoLines($record['formatted']); $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']], $record['datetime']); foreach ($lines as $line) { $this->socket->write($line, $header); } } public function close(): void { $this->socket->close(); } /** * @param string|string[] $message * @return string[] */ private function splitMessageIntoLines($message): array { if (is_array($message)) { $message = implode("\n", $message); } $lines = preg_split('/$\R?^/m', (string) $message, -1, \PREG_SPLIT_NO_EMPTY); if (\false === $lines) { $pcreErrorCode = preg_last_error(); throw new \RuntimeException('Could not preg_split: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); } return $lines; } /** * Make common syslog header (see rfc5424 or rfc3164) */ protected function makeCommonSyslogHeader(int $severity, DateTimeInterface $datetime): string { $priority = $severity + $this->facility; if (!$pid = getmypid()) { $pid = '-'; } if (!$hostname = gethostname()) { $hostname = '-'; } if ($this->rfc === self::RFC3164) { // see https://github.com/phpstan/phpstan/issues/5348 // @phpstan-ignore-next-line $dateNew = $datetime->setTimezone(new \DateTimeZone('UTC')); $date = $dateNew->format($this->dateFormats[$this->rfc]); return "<{$priority}>" . $date . " " . $hostname . " " . $this->ident . "[" . $pid . "]: "; } $date = $datetime->format($this->dateFormats[$this->rfc]); return "<{$priority}>1 " . $date . " " . $hostname . " " . $this->ident . " " . $pid . " - - "; } /** * Inject your own socket, mainly used for testing */ public function setSocket(UdpSocket $socket): self { $this->socket = $socket; return $this; } }
Save