src/db/BuildSql.php
public function addErrorSqlLog()
    {

        //如果没有写入权限尝试修改权限 如果修改后还是失败 则跳过
        if (isWritable(DATA_PATH)) {
            $path = DATA_SQL_PATH . $this->options['database'] . DS;
            is_dir($path) ? '' : mkdir($path, 0755, true);

            $path .= 'error_' . date('Y_m_d_H', TIME) . '.text';

            $info = '------ ' . $this->sqlInfo['time'];
            $info .= ' | ' . date('Y-m-d H:i:s', TIME);
            $info .= ' | ip:' . getIP();
            $info .= ' | Url:' . URL . '/' . Route::$uri;
            $info .= PHP_EOL;

            $content = $this->sqlInfo['sql'] . ';' . PHP_EOL . '来源：' . $_SERVER['HTTP_USER_AGENT'] . PHP_EOL . '--------------' . PHP_EOL;

            error_log($content . $info, 3, $path);

        }
    }
public function addErrorSqlLog()
    {

        //如果没有写入权限尝试修改权限 如果修改后还是失败 则跳过
        if (isWritable(DATA_PATH)) {
            $path = DATA_SQL_PATH . $this->options['database'] . DS;
            is_dir($path) ? '' : mkdir($path, 0755, true);

            $path .= 'error_' . date('Y_m_d_H', TIME) . '.text';

            $info = '------ ' . $this->sqlInfo['time'];
            $info .= ' | ' . date('Y-m-d H:i:s', TIME);
            $info .= ' | ip:' . getIP();
            $info .= ' | Url:' . URL . '/' . Route::$uri;
            $info .= PHP_EOL;

            $content = $this->sqlInfo['sql'] . ';' . PHP_EOL . '来源：' . $_SERVER['HTTP_USER_AGENT'] . PHP_EOL . '--------------' . PHP_EOL;

            error_log($content . $info, 3, $path);

        }
    }
保存错误SQL记录