getFullText() . PHP_EOL); fflush($fh); flock($fh, LOCK_UN); fclose($fh); } self::$buffer = []; self::$autoFlush = true; } public static function getLogPath() { return TextHelper::absolutePath(getConfig()->main->logsPath . DS . date('Y-m') . '.log'); } public static function log($text, array $tokens = []) { self::$buffer []= new LogEvent($text, $tokens); if (self::$autoFlush) self::flush(); } //methods for manipulating buffered logs public static function getBuffer() { return self::$buffer; } public static function setBuffer(array $buffer) { self::$buffer = $buffer; } } Logger::init();