monsterhunter / yii2-log
yii2-log
Installs: 4 875
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- yiisoft/yii2: ^2.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-11-05 00:20:53 UTC
README
Yii2 Log Module
Run migrations
php yii migrate --migrationPath=@yii/log/migrations/
Config backend module
'modules'=> [ 'log' => [ 'class' => 'monsterhunter\yii2\log\Module', //'layout' =>'@app/views/layouts/main' //custom layout ] ]
Config log compoennt
'components' => [ 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\DbTarget', 'levels' => ['error', 'warning'], 'except' => ['yii\web\HttpException:404'], 'prefix' => function () { $url = !Yii::$app->request->isConsoleRequest ? Yii::$app->request->getUrl() : null; return sprintf('[%s][%s]', Yii::$app->id, $url); }, 'logVars' => [], 'logTable' => '{{%system_log}}' ], ], ], ]