OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
monolog
/
monolog
/
src
/
Monolog
/
Processor
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
π
..
-
08/12/2024 10:35:58 AM
rwxr-xr-x
π
ClosureContextProcessor.php
1.53 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
GitProcessor.php
2.01 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
HostnameProcessor.php
773 bytes
08/12/2024 10:35:58 AM
rw-r--r--
π
IntrospectionProcessor.php
3.74 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
LoadAverageProcessor.php
1.66 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
MemoryPeakUsageProcessor.php
903 bytes
08/12/2024 10:35:58 AM
rw-r--r--
π
MemoryProcessor.php
1.82 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
MemoryUsageProcessor.php
884 bytes
08/12/2024 10:35:58 AM
rw-r--r--
π
MercurialProcessor.php
1.95 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
ProcessIdProcessor.php
667 bytes
08/12/2024 10:35:58 AM
rw-r--r--
π
ProcessorInterface.php
603 bytes
08/12/2024 10:35:58 AM
rw-r--r--
π
PsrLogMessageProcessor.php
3.07 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
TagProcessor.php
1.24 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
UidProcessor.php
1.52 KB
08/12/2024 10:35:58 AM
rw-r--r--
π
WebProcessor.php
3.5 KB
08/12/2024 10:35:58 AM
rw-r--r--
Editing: UidProcessor.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\Processor; use Monolog\ResettableInterface; use Monolog\LogRecord; /** * Adds a unique identifier into records * * @author Simon MΓΆnch <sm@webfactory.de> */ class UidProcessor implements ProcessorInterface, ResettableInterface { /** @var non-empty-string */ private string $uid; /** * @param int<1, 32> $length */ public function __construct(int $length = 7) { if ($length > 32 || $length < 1) { throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); } $this->uid = $this->generateUid($length); } /** * @inheritDoc */ public function __invoke(LogRecord $record): LogRecord { $record->extra['uid'] = $this->uid; return $record; } public function getUid(): string { return $this->uid; } public function reset(): void { $this->uid = $this->generateUid(\strlen($this->uid)); } /** * @param positive-int $length * @return non-empty-string */ private function generateUid(int $length): string { return substr(bin2hex(random_bytes((int) ceil($length / 2))), 0, $length); } }