PHPackages                             gaocheng/actionlog - 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. gaocheng/actionlog

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

gaocheng/actionlog
==================

A laravel package of ActionLog

27PHP

Since Jun 12Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

action log
==========

[](#action-log)

Laravel 5 操作日志自动记录

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

[](#installation)

The ActionLog Service Provider can be installed via [Composer](http://getcomposer.org) by requiring the `gaocheng/actionlog` package and setting the `minimum-stability` to `dev` (required for Laravel 5) in your project's `composer.json`.

```
{
    "require": {

        "gaocheng/actionlog": "~1.0"
    },

}
```

or

Require this package with composer:

```
composer require gaocheng/actionlog

```

Update your packages with `composer update` or install with `composer install`.

Usage
-----

[](#usage)

To use the ActionLog Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the `providers` key in `config/app.php` and register the ActionLog Service Provider.

```
    'providers' => [
        // ...
        'gaocheng\ActionLog\ActionLogServiceProvider',
    ]
```

for Laravel 5.1+

```
    'providers' => [
        // ...
        gaocheng\ActionLog\ActionLogServiceProvider::class,
    ]
```

Find the `aliases` key in `config/app.php`.

```
    'aliases' => [
        // ...
        'ActionLog' => 'gaocheng\ActionLog\Facades\ActionLogFacade',
    ]
```

for Laravel 5.1+

```
    'aliases' => [
        // ...
        'ActionLog' => gaocheng\ActionLog\Facades\ActionLogFacade::class,
    ]
```

Configuration
-------------

[](#configuration)

To use your own settings, publish config.

`$ php artisan vendor:publish`

`config/actionlog.php`

```
    /*
    |--------------------------------------------------------------------------
    | Package Connection
    |--------------------------------------------------------------------------
    |
    | You can set a different database connection for this package. It will set
    | new connection for models ActionLog. When this option is null,
    | it will connect to the main database, which is set up in database.php
    |
    */

    'connection' => null,

    /*
    |--------------------------------------------------------------------------
    | Package Models
    |--------------------------------------------------------------------------
    |
    | You can set up same models that requires logging. When this option is null,
    | no logging will be done.
    |
    */

    'models' => [
        '\App\User',
    ],
```

Last Step
---------

[](#last-step)

run: `$ php artisan migrate`

Demo
----

[](#demo)

自动记录操作日志，数据库操作需按如下:

```
update

$users = Users::find(1);
$users->name = "myname";
$users->save();

add

$users = new Users();
$users->name = "myname";
$users->save()

delete

Users:destroy(1);
```

主动记录操作日志

```
use ActionLog

ActionLog::createActionLog($type,$content);
```

感谢

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb29104e7be3e3dbf1fa02fe16eb13f680e3b64e4dd56a8f6e231e373600799d?d=identicon)[gaocheng](/maintainers/gaocheng)

### Embed Badge

![Health badge](/badges/gaocheng-actionlog/health.svg)

```
[![Health](https://phpackages.com/badges/gaocheng-actionlog/health.svg)](https://phpackages.com/packages/gaocheng-actionlog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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