2016-11-24 79 views

回答

1

使用记录仪:

'log' => [ 
'targets' => [[ 
    ... 
], [ 
    'class' => 'yii\log\FileTarget', 
    'logFile' => '@runtime/logs/profile.log', 
    'logVars' => [], 
    'levels' => ['profile'], 
    'categories' => ['yii\db\Command::query'], 
    'prefix' => function($message) { 
     return ''; 
    } 
]] 

]

+0

还有一个属性' 'microtime中'=>成立,'有很大帮助看到SQL性能问题。 –