Revert "Merge tag 'v2.10.6'"

This reverts commit 122ea4ab9e, reversing
changes made to c54a11e250.
This commit is contained in:
2024-02-16 23:06:09 -06:00
parent 122ea4ab9e
commit 6c08ee9675
521 changed files with 12363 additions and 14503 deletions

View File

@@ -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