# yii2-admin-logging **Repository Path**: fbi/yii2-admin-logging ## Basic Information - **Project Name**: yii2-admin-logging - **Description**: Yii2的用户管理日志,用以追溯用户管理 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2015-01-08 - **Last Updated**: 2021-05-03 ## Categories & Tags **Categories**: logging **Tags**: None ## README Admin logging for Yii 2 ======================== Installation ------------ The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Either run ``` php composer.phar require fbi/yii2-admin-logging "*" ``` for dev-master ``` php composer.phar require fbi/yii2-admin-logging "dev-master" ``` or add ``` "fbi/yii2-admin-logging": "*" ``` to the require section of your `composer.json` file. Usage ----- Once the extension is installed, simply modify your application configuration as follows: ```php return [ 'components' => [ .... 'user' => [ 'class'=>'fbi\adminLogging\components\User', .... ] .... 'request' => [ 'class'=>'fbi\adminLogging\components\Request', ], ]; ``` and change your backend contorllers like follows: ``` .... use fbi\adminLogging\controllers\Controller;//this line .... class SiteController extends Controller{ ... } ``` and if you want to log something in the application: ``` Yii::$app->user->log('mixed variable,anything you want to log'); ``` [sanwkj@163.com](mailto:sanwkj@163.com?subject=yii2-admin-logging)