set defaults for log_net / log_logstash
This commit is contained in:
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user