2020
10-08
10-08
Yii使用DbTarget实现日志功能的示例代码
一:在配置文件的log组件中配置DbTarget'log'=>['traceLevel'=>YII_DEBUG?3:0,'targets'=>[['class'=>'yii\log\FileTarget','levels'=>['error','warning'],],'test'=>['class'=>'yii\log\DbTarget',//DaTarget类'logTable'=>'{{%test_log}}',//日志表'levels'=>['error','info','warning'],//日志等级],],],二:生成日志表在项目目录下执行如下命令生成日志表phpyiimig...
继续阅读 >