蝉知门户系统迁移到SAE平台-日志相关

来源:互联网 发布:剑网三道姑捏脸数据 编辑:程序博客网 时间:2024/06/10 03:57

    zentaophp框架中有记录日志的部分,原有记录方式是读写日志文件。需修改为sae_debug()方式。查看源代码router.class.php内的saveSQL()与saveError($level, $message, $file, $line)方法需进行修改。

    saveError方法仅修改fwrite为sae_debug即可。

        //$fh = @fopen($errorFile, 'a');        //if($fh) fwrite($fh, strip_tags($errorLog)) && fclose($fh);        sae_debug(strip_tags($errorLog));

    saveSQL方法进行重写。

    public function saveSQL()    {        if(!class_exists('dao')) return;/*        $sqlLog = $this->getLogRoot() . 'sql.' . date('Ymd') . '.log';        //$fh = @fopen($sqlLog, 'a');        //if(!$fh) return false;        //fwrite($fh, date('Ymd H:i:s') . ": " . $this->getURI() . "\n");        sae_debug($fh, date('Ymd H:i:s') . ": " . $this->getURI() . "\n");        foreach(dao::$querys as $query) fwrite($fh, "  $query\n");        fwrite($fh, "\n");        fclose($fh);*/$logs = date('Ymd H:i:s') . ": " . $this->getURI() . "\n";foreach(dao::$querys as $query) $logs .= "  $query\n";sae_debug($logs);    }

0 0
原创粉丝点击