thinkphp3.2开启所有日志运行时间日志级别不显示

SHOW_PAGE_TRACE

日志文件配置

return array(
    'LOG_RECORD' => true,
    'LOG_TYPE' => 'File',
    'LOG_FILE_SIZE' => 10,
    'LOG_LEVEL' => 'EMERG,ALERT,CRIT,ERR,WARN,NOTICE,INFO,DEBUG,SQL',
'SHOW_PAGE_TRACE' => FALSE, //这里必须为FALSE才会显示所有日志。可以去看核心源码

\Core\Library\Think\Think.class.php

    static public function trace($value = '[think]', $label = '', $level = 'DEBUG', $record = false) {
        static $_trace = array();
        if ('[think]' === $value) { // 获取trace信息
            return $_trace;
        } else {
            $info = ($label ? $label . ':' : '') . print_r($value, true);
            $level = strtoupper($level);

            if ((defined('IS_AJAX') && IS_AJAX) || !C('SHOW_PAGE_TRACE') || $record) {//这里判断了MIKE.....
                Log::record($info, $level, $record);
            } else {
                if (!isset($_trace[$level]) || count($_trace[$level]) > C('TRACE_MAX_RECORD')) {
                    $_trace[$level] = array();
                }
                $_trace[$level][] = $info;
            }
        }
    }

 

你可能感兴趣的:(thinkphp)