!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/vendor/monolog/monolog/src/Monolog/Formatter/   drwxrwxr-x
Free 13.22 GB of 57.97 GB (22.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     GelfMessageFormatter.php (4.89 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?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\Formatter;

use 
Monolog\Logger;
use 
Gelf\Message;
use 
Monolog\Utils;

/**
 * Serializes a log message to GELF
 * @see http://docs.graylog.org/en/latest/pages/gelf.html
 *
 * @author Matt Lehner <mlehner@gmail.com>
 *
 * @phpstan-import-type Level from \Monolog\Logger
 */
class GelfMessageFormatter extends NormalizerFormatter
{
    protected const 
DEFAULT_MAX_LENGTH 32766;

    
/**
     * @var string the name of the system for the Gelf log message
     */
    
protected $systemName;

    
/**
     * @var string a prefix for 'extra' fields from the Monolog record (optional)
     */
    
protected $extraPrefix;

    
/**
     * @var string a prefix for 'context' fields from the Monolog record (optional)
     */
    
protected $contextPrefix;

    
/**
     * @var int max length per field
     */
    
protected $maxLength;

    
/**
     * Translates Monolog log levels to Graylog2 log priorities.
     *
     * @var array<int, int>
     *
     * @phpstan-var array<Level, int>
     */
    
private $logLevels = [
        
Logger::DEBUG     => 7,
        
Logger::INFO      => 6,
        
Logger::NOTICE    => 5,
        
Logger::WARNING   => 4,
        
Logger::ERROR     => 3,
        
Logger::CRITICAL  => 2,
        
Logger::ALERT     => 1,
        
Logger::EMERGENCY => 0,
    ];

    public function 
__construct(?string $systemName null, ?string $extraPrefix nullstring $contextPrefix 'ctxt_', ?int $maxLength null)
    {
        
parent::__construct('U.u');

        
$this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName;

        
$this->extraPrefix is_null($extraPrefix) ? '' $extraPrefix;
        
$this->contextPrefix $contextPrefix;
        
$this->maxLength is_null($maxLength) ? self::DEFAULT_MAX_LENGTH $maxLength;
    }

    
/**
     * {@inheritDoc}
     */
    
public function format(array $record): Message
    
{
        
$context $extra = [];
        if (isset(
$record['context'])) {
            
/** @var mixed[] $context */
            
$context parent::normalize($record['context']);
        }
        if (isset(
$record['extra'])) {
            
/** @var mixed[] $extra */
            
$extra parent::normalize($record['extra']);
        }

        if (!isset(
$record['datetime'], $record['message'], $record['level'])) {
            throw new 
\InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($recordtrue).' given');
        }

        
$message = new Message();
        
$message
            
->setTimestamp($record['datetime'])
            ->
setShortMessage((string) $record['message'])
            ->
setHost($this->systemName)
            ->
setLevel($this->logLevels[$record['level']]);

        
// message length + system name length + 200 for padding / metadata
        
$len 200 strlen((string) $record['message']) + strlen($this->systemName);

        if (
$len $this->maxLength) {
            
$message->setShortMessage(Utils::substr($record['message'], 0$this->maxLength));
        }

        if (isset(
$record['channel'])) {
            
$message->setFacility($record['channel']);
        }
        if (isset(
$extra['line'])) {
            
$message->setLine($extra['line']);
            unset(
$extra['line']);
        }
        if (isset(
$extra['file'])) {
            
$message->setFile($extra['file']);
            unset(
$extra['file']);
        }

        foreach (
$extra as $key => $val) {
            
$val is_scalar($val) || null === $val $val $this->toJson($val);
            
$len strlen($this->extraPrefix $key $val);
            if (
$len $this->maxLength) {
                
$message->setAdditional($this->extraPrefix $keyUtils::substr((string) $val0$this->maxLength));

                continue;
            }
            
$message->setAdditional($this->extraPrefix $key$val);
        }

        foreach (
$context as $key => $val) {
            
$val is_scalar($val) || null === $val $val $this->toJson($val);
            
$len strlen($this->contextPrefix $key $val);
            if (
$len $this->maxLength) {
                
$message->setAdditional($this->contextPrefix $keyUtils::substr((string) $val0$this->maxLength));

                continue;
            }
            
$message->setAdditional($this->contextPrefix $key$val);
        }

        
/** @phpstan-ignore-next-line */
        
if (null === $message->getFile() && isset($context['exception']['file'])) {
            if (
preg_match("/^(.+):([0-9]+)$/"$context['exception']['file'], $matches)) {
                
$message->setFile($matches[1]);
                
$message->setLine($matches[2]);
            }
        }

        return 
$message;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0064 ]--