protected function write($message, $level = false)
    {
        $now  = \DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''));
        $line = array(
            'pid'  => self::$pid,
            'time' => $now->format("d/m/Y H:i:s.u")
        );
        if ($level !== false) {
            $line['$level'] = $level;
        } else {
            $line['$level'] = '........';
        }
        $line['mesg'] = $message;
        if (!$this->cache) {
            $this->flush();
        }
        $this->tabCache[] = $line;
        try {
            $params = [
                'appCode'    => APP_NAME,
                'appClient'  => '',
                'appSession' => session_id(),
                'appTs'      => microtime(),
                'appDate'    => date('c'),
                'appType'    => $level,
                'appErrNum'  => 0,
                'appErrMsg'  => (string)$message,
                'appErrFile' => '',
                'appErrLine' => 0,
                'appData'    => []
            ];
            if (isset($_SERVER) && array_key_exists('REQUEST_URI', $_SERVER)) {
                $params['requestUri'] = $_SERVER['REQUEST_URI'];
                $params['requestIp']  = self::getClientIp();
                $params['requestUA']  = $_SERVER['HTTP_USER_AGENT'];
                if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
                    $params['requestLg'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
                }
            }
            $this->tabBeat[] = $params;
        } catch (\Exception $ex) {
            // @nothing
        }
        if (!$this->cache) {
            $this->commit();
        }
        return $this;
    }