Yii2 指定log存放的文件
在main.php 文件里添加
'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], 'logVars' => ['*'], ], [ 'class' => 'yii\log\FileTarget', 'categories' => ['currency'], 'levels' => ['error', 'warning', 'info'], 'logVars' => ['*'], 'logFile' => '@common/runtime/logs/currency.log', ] ], ],