Home  >  Article  >  PHP Framework  >  How to enable debugging mode in yii

How to enable debugging mode in yii

(*-*)浩
(*-*)浩Original
2019-12-04 12:00:315420browse

How to enable debugging mode in yii

# (Recommended learning: yii framework )

main.php

Open debugging Mode:

define('YII_DEBUG', true); //是否调试BUG,本地测试请打开
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);

Add log configuration:

'log' => array(
    'class' => 'CLogRouter',
    'routes' => array(
        array(
            'class' => 'CFileLogRoute',
            'levels' => 'error, warning',
        ),
        array(
            'class'=>'CWebLogRoute',
            'levels'=>'trace',//提示的级别
            'categories'=>'system.db.*',
        ),
    ),
),

The above is the detailed content of How to enable debugging mode in yii. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is yii csrfNext article:What is yii csrf