yii2 自定义日志文件路径,方便调试

$time = microtime(true);
$log = new FileTarget();
$log->logFile = Yii::$app->getRuntimePath() . '/logs/songlin.log';
$log->messages[] = ['这个地方出问题了:'.$data.PHP_EOL ,1,'aaaa',$time];
$log->export();

你可能感兴趣的:(yii2 自定义日志文件路径,方便调试)