/home/techb158/immovalet.com/vendor/monolog/monolog/src/Monolog/Handler
NameSizeModeActions
Curl/-0755rm
FingersCrossed/-0755rm
Slack/-0755rm
SyslogUdp/-0755rm
AbstractHandler.php26510644editdlrm
AbstractProcessingHandler.php19140644editdlrm
AbstractSyslogHandler.php35400644editdlrm
AmqpHandler.php39400644editdlrm
BrowserConsoleHandler.php83820644editdlrm
BufferHandler.php46440644editdlrm
ChromePHPHandler.php52290644editdlrm
CouchDBHandler.php21030644editdlrm
CubeHandler.php52850644editdlrm
DeduplicationHandler.php60630644editdlrm
DoctrineCouchDBHandler.php11280644editdlrm
DynamoDbHandler.php24820644editdlrm
ElasticaHandler.php33280644editdlrm
ElasticsearchHandler.php52970644editdlrm
ErrorLogHandler.php25870644editdlrm
FallbackGroupHandler.php17610644editdlrm
FilterHandler.php68430644editdlrm
FingersCrossedHandler.php84690644editdlrm
FirePHPHandler.php52880644editdlrm
FleepHookHandler.php32130644editdlrm
FlowdockHandler.php31380644editdlrm
FormattableHandlerInterface.php8450644editdlrm
FormattableHandlerTrait.php12810644editdlrm
GelfHandler.php13990644editdlrm
GroupHandler.php32340644editdlrm
Handler.php10290644editdlrm
HandlerInterface.php30320644editdlrm
HandlerWrapper.php33580644editdlrm
IFTTTHandler.php20260644editdlrm
InsightOpsHandler.php17100644editdlrm
LogEntriesHandler.php15290644editdlrm
LogglyHandler.php40980644editdlrm
LogmaticHandler.php23120644editdlrm
MailHandler.php23410644editdlrm
MandrillHandler.php24730644editdlrm
MissingExtensionException.php4730644editdlrm
MongoDBHandler.php25450644editdlrm
NativeMailerHandler.php49710644editdlrm
NewRelicHandler.php62110644editdlrm
NoopHandler.php8800644editdlrm
NullHandler.php13370644editdlrm
OverflowHandler.php45330644editdlrm
PHPConsoleHandler.php104720644editdlrm
ProcessableHandlerInterface.php11970644editdlrm
ProcessableHandlerTrait.php17370644editdlrm
ProcessHandler.php52150644editdlrm
PsrHandler.php24400644editdlrm
PushoverHandler.php77310644editdlrm
RedisHandler.php29880644editdlrm
RedisPubSubHandler.php17880644editdlrm
RollbarHandler.php34120644editdlrm
RotatingFileHandler.php62300644editdlrm
SamplingHandler.php43380644editdlrm
SendGridHandler.php27110644editdlrm
SlackHandler.php66660644editdlrm
SlackWebhookHandler.php37590644editdlrm
SocketHandler.php108660644editdlrm
SqsHandler.php16990644editdlrm
StreamHandler.php58080644editdlrm
SwiftMailerHandler.php33420644editdlrm
SyslogHandler.php18410644editdlrm
SyslogUdpHandler.php42870644editdlrm
TelegramBotHandler.php55150644editdlrm
TestHandler.php67500644editdlrm
WebRequestRecognizerTrait.php5240644editdlrm
WhatFailureGroupHandler.php16690644editdlrm
ZendMonitorHandler.php31370644editdlrm
Edit: /home/techb158/immovalet.com/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php (4287B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use DateTimeInterface; use Monolog\Logger; use Monolog\Handler\SyslogUdp\UdpSocket; use Monolog\Utils; /** * A Handler for logging to a remote syslogd server. * * @author Jesper Skovgaard Nielsen * @author Dominik Kukacka */ class SyslogUdpHandler extends AbstractSyslogHandler { const RFC3164 = 0; const RFC5424 = 1; const RFC5424e = 2; /** @var array */ 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. * * @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) { 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; } }