PHPackages                             rikcage/yii2-user-logs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. rikcage/yii2-user-logs

ActiveYii2-extension[Logging &amp; Monitoring](/categories/logging)

rikcage/yii2-user-logs
======================

User logs actions YII2

0.0.2(7y ago)37501MITPHP

Since Oct 5Pushed 7y agoCompare

[ Source](https://github.com/rikcage/yii2-user-logs)[ Packagist](https://packagist.org/packages/rikcage/yii2-user-logs)[ RSS](/packages/rikcage-yii2-user-logs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

yii2-user-logs
==============

[](#yii2-user-logs)

full and comfortable logs of user actions (visited pages), insert, update, delete

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

To install, either run

```
$ php composer.phar require rikcage/yii2-user-logs "*"

```

or add

```
"rikcage/yii2-user-logs": "*"

```

to the `require` section of your `composer.json` file.

Run migration to create `logs` table (it means that a connection to the database is already configured for the application)

```
./yii migrate --migrationPath=@rikcage/user-logs/migrations

```

Add the module
==============

[](#add-the-module)

Include module to the config file (`backend/config/main.php` for advanced app or `config/web.php` and `config/console` for basic app)

```
	'modules' => [
    ...
		'logs' => [ // you can create several 'logs', 'logs_admin', etc. sections
                    // if you want another table different from '{{%logs}} or several tables
			'class' => 'rikcage\user_logs\UserLogs',
			'params' => [
				'userClass' => 'account\models\User',
				'username' => 'user_name',
				'userid' => 'user_id',
				//'log_table' => '{{%logs_admin}}', // if you want another table different from '{{%logs}}', default 'log_table' => '{{%logs}}'
			],
			'access_rules' => [ // Setting permissions for viewing logs (http://your_site/logs/logs)
				[
					'actions' => null, //for all
					'allow' => true,
					'roles' => ['@'],
				],
            ],
			//'behaviors_params' => [ // additional settings of the behaviors () method for Logic Controller,
                                    // eg using access control extensions.
			//	'as AccessBehavior' => [
			//		'class' => AccessBehavior::className(),
			//	],
			//],
			//'virtual_cron' => false, //default virtual_cron=true once a day deletes old logs for disable use virtual_cron=false
			//'var_name_last_delete' => 'logs_last_delete', // variable name the date of the last clean of the log, default var_name_last_delete=logs_last_delete
			'logs_live' => '-100 day', // lifetime of log
			'gitignore_list' => [ // ignored events of controllers and models.
				'rikcage\user_logs\controllers\LogsController',
			],

		],
	],
```

for disable use virtual\_cron set `'virtual_cron' => false`

Installation guide for the Controller
-------------------------------------

[](#installation-guide-for-the-controller)

add to your Controller

```
use rikcage\user_logs\models\UserLog;

    ...

	public function beforeAction($action)
	{
		if (!parent::beforeAction($action)) {
			return false;
		}
		UserLog::initTable('logs'); // if you want another section with settings different from 'logs_admin' model
		$log = new UserLog;
		$log->actionlog('ACTION', $this);

		return true;
	}
```

Installation guide for the Model
--------------------------------

[](#installation-guide-for-the-model)

add to your Model

```
use rikcage\user_logs\models\UserLog;

    ...

	public function behaviors()
	{
    ...
        //UserLog::initTable('logs_admin'); // if you want another section with settings different from 'logs' model
		return [
    ...
			UserLog::className(),
		];
	}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~118 days

Total

2

Last Release

2658d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29402340?v=4)[rik cage](/maintainers/rikcage)[@rikcage](https://github.com/rikcage)

---

Tags

logsdbyii2Usersactions

### Embed Badge

![Health badge](/badges/rikcage-yii2-user-logs/health.svg)

```
[![Health](https://phpackages.com/badges/rikcage-yii2-user-logs/health.svg)](https://phpackages.com/packages/rikcage-yii2-user-logs)
```

###  Alternatives

[bedezign/yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.

201657.4k4](/packages/bedezign-yii2-audit)[mito/yii2-sentry

Yii 2 extension for Sentry

92377.7k](/packages/mito-yii2-sentry)[understand/understand-laravel

Laravel 5, 6, 7, 8, 9, 10, 11 and 12 service provider for Understand.io

24106.2k](/packages/understand-understand-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
