set defaults for log_net / log_logstash

This commit is contained in:
Shish
2023-02-16 19:30:24 +00:00
parent 45704f1775
commit b5bbff531c
2 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,12 @@ namespace Shimmie2;
class LogLogstash extends Extension class LogLogstash extends Extension
{ {
public function onInitExt(InitExtEvent $event)
{
global $config;
$config->set_default_string("log_logstash_host", "127.0.0.1:1234");
}
public function onLog(LogEvent $event) public function onLog(LogEvent $event)
{ {
global $user; global $user;

View File

@ -8,6 +8,12 @@ class LogNet extends Extension
{ {
private int $count = 0; private int $count = 0;
public function onInitExt(InitExtEvent $event)
{
global $config;
$config->set_default_string("log_net_host", "127.0.0.1:35353");
}
public function onLog(LogEvent $event) public function onLog(LogEvent $event)
{ {
global $user; global $user;
@ -28,7 +34,7 @@ class LogNet extends Extension
private function msg($data) private function msg($data)
{ {
global $config; global $config;
$host = $config->get_string("log_net_host", "127.0.0.1:35353"); $host = $config->get_string("log_net_host");
if (!$host) { if (!$host) {
return; return;