do not log multiple times due to pushing log-handlers multiple times

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-09-15 13:49:40 +02:00
parent 6ef2be8c1a
commit 5a8ae0f75f

View File

@@ -40,6 +40,13 @@ class FroxlorLogger
*/ */
private static $userinfo = array(); private static $userinfo = array();
/**
* whether the logger object has already been initialized
*
* @var bool
*/
private static $is_initialized = false;
const USR_ACTION = '10'; const USR_ACTION = '10';
const RES_ACTION = '20'; const RES_ACTION = '20';
@@ -72,6 +79,7 @@ class FroxlorLogger
} }
} }
if (self::$is_initialized == false) {
foreach (self::$logtypes as $logger) { foreach (self::$logtypes as $logger) {
switch ($logger) { switch ($logger) {
@@ -86,6 +94,8 @@ class FroxlorLogger
break; break;
} }
} }
self::$is_initialized = true;
}
} }
/** /**