pvsaintpe / yii2-log
Package
Installs: 3 792
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.1.3
- pvsaintpe/yii2-behaviors: *
- pvsaintpe/yii2-db-plus: *
- pvsaintpe/yii2-search: 5.*
- yiisoft/yii2: 2.0.*
- yiisoft/yii2-authclient: 2.*
- yiisoft/yii2-bootstrap: 2.*
- yiisoft/yii2-imagine: 2.*
- dev-release
- 8.0.1
- 7.0.1
- 7.0.0
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.1.14
- 5.1.13
- 5.1.12
- 5.1.11
- 5.1.10
- 5.1.9
- 5.1.8
- 5.1.7
- 5.1.6
- 5.1.5
- 5.1.4
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0-alpha
- 3.7.6
- 3.7.5
- 3.7.4
- 3.7.3
- 3.7.2
- 3.7.1
- 3.6.2
- 3.6.1
- 3.5.5
- 3.5.4
- 3.5.3
- 3.5.2
- 3.5.1
- 3.4.24
- 3.4.23
- 3.4.22
- 3.4.21
- 3.4.20
- 3.4.19
- 3.4.18
- 3.4.17
- 3.4.16
- 3.4.15
- 3.4.14
- 3.4.13
- 3.4.12
- 3.4.11
- 3.4.10
- 3.4.9
- 3.4.8
- 3.4.7
- 3.4.6
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.16
- 3.2.15
- 3.2.14
- 3.2.13
- 3.2.12
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.8
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.13
- 3.1.12
- 3.1.11
- 3.1.10
- 3.1.9
- 3.0.10
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.3
- 2.0.2
- 2.0.1
- v1.0.38
- v1.0.37
- v1.0.36
- v1.0.35
- v1.0.32
- v1.0.31
- v1.0.30
- v1.0.29
- v1.0.28
- v1.0.26
- v1.0.25
- v1.0.23
- v1.0.22
- v1.0.21
- v1.0.20
- v1.0.17
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.7
- v1.0.6
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.0
- dev-master
- dev-new-log
- dev-refactor
This package is auto-updated.
Last update: 2024-12-09 05:15:09 UTC
README
Installation
The preferred way to install this extension is through composer.
Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json. Either run
$ php composer.phar require pvsaintpe/yii2-log "8.*"
or add
"pvsaintpe/yii2-log": "8.*"
to the require section of your composer.json file.
Additional information
All base models and query must be inherited from:
ActiveRecord extends \pvsaintpe\log\components\ActiveRecord
ActiveQuery extends \pvsaintpe\log\components\ActiveQuery
To track changes, add to your model:
/** * @return bool */ public static function logEnabled() { return true; }
Build project
Every time when you change the database schema to be logged, run the command:
#!/usr/bin/env bash
php ./yii changelog/generate
php ./yii changelog/migrate --interactive=0
Customization
- To access the visual part, for example, to view revisions and change history of your data, add to the config:
// backend/configs/main.php return [ 'modules' => [ 'changelog' => [ 'class' => 'pvsaintpe\log\Module', ], ] ];
- To fine-tune the logging system, use the configurator. For a complete list of available options, see pvsaintpe\log\components\Configs:
// common/configs/params.php return [ 'changelog.configs' => [ 'db' => 'dbLog', // DB Storage for Log-tables 'storageDb' => 'db', // DB Storage for Data-tables 'adminTable' => 'admin', // Table Name for Admin's 'tablePrefix' => '_log', 'adminColumn => 'updated_by', ], ];
Usage
To activate all features of the component, use pvsaintpe\log\traits\SearchTrait in your Search-models. It is recommended to keep the log data in a separate database, although you are not limited in this.