Revert "Merge tag 'v2.10.6'"
This reverts commit122ea4ab9e
, reversing changes made toc54a11e250
.
This commit is contained in:
@@ -6,13 +6,13 @@ namespace Shimmie2;
|
||||
|
||||
class LogLogstash extends Extension
|
||||
{
|
||||
public function onInitExt(InitExtEvent $event): void
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
$config->set_default_string("log_logstash_host", "127.0.0.1:1234");
|
||||
}
|
||||
|
||||
public function onLog(LogEvent $event): void
|
||||
public function onLog(LogEvent $event)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@@ -39,10 +39,7 @@ class LogLogstash extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function send_data(array $data): void
|
||||
private function send_data($data)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@@ -56,10 +53,10 @@ class LogLogstash extends Extension
|
||||
$host = $parts[0];
|
||||
$port = (int)$parts[1];
|
||||
$fp = fsockopen("udp://$host", $port, $errno, $errstr);
|
||||
if (!$fp) {
|
||||
if (! $fp) {
|
||||
return;
|
||||
}
|
||||
fwrite($fp, json_encode_ex($data));
|
||||
fwrite($fp, json_encode($data));
|
||||
fclose($fp);
|
||||
} catch (\Exception $e) {
|
||||
// we can't log that logging is broken
|
||||
|
Reference in New Issue
Block a user