This component is a Yii 2 wrapper of Log.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist frmaxm/simple-event-logger "dev-master"
or add
"frmaxm/simple-event-logger": "dev-master"
to the require section of your composer.json file.
Edit bootstrap section in your application config file:
'bootstrap' => [
'model_log'=>[
'class'=>'frmaxm\logger\bootstrap\ModelLogBootstrap',
'category'=>'admin',
],
'log'=>[
'class'=>'yii\log\Logger',
'flushInterval' => 50,
],
]Edit log component in your application config file:
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\DbTarget',
'categories' => ['model.*'],
],
],
]Add new table EventLog to your database.
Run module migration:
php yii migrate --migrationPath=@frmaxm/simple-event-logger/migrationsAll events on the model will be recorded in the Event Log table. This will allow you to see all the user's actions.