PHPackages                             pico-inno/simplelog - 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. pico-inno/simplelog

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

pico-inno/simplelog
===================

For record logs for every activities

1.1.6(7mo ago)1140MITPHP

Since Oct 4Pushed 7mo agoCompare

[ Source](https://github.com/pico-inno/simplelog)[ Packagist](https://packagist.org/packages/pico-inno/simplelog)[ RSS](/packages/pico-inno-simplelog/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (11)Used By (0)

Pico Inno Simple Log
====================

[](#pico-inno-simple-log)

Usage
-----

[](#usage)

Use the trait **SimpleLog** trait in the model to start logging. You must add a method **getLogOptions** in order to config the setting for logging for current model.

```
use PicoInno\SimpleLog\Trait\SimpleLog;

class ExampleClass extends Model {

    use SimpleLog;

    public function getLogOptions(): LogOptions
    {
        return LogOptions::defaults();
    }

}
```

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require pico-inno/simplelog
```

⚙️ Publish Config and Migrations
--------------------------------

[](#️-publish-config-and-migrations)

After installing, publish the configuration file and migrations:

```
php artisan vendor:publish --provider="PicoInno\SimpleLog\SimpleLogServiceProvider" --tag=config

php artisan vendor:publish --provider="PicoInno\SimpleLog\SimpleLogServiceProvider" --tag=migrations

```

This will publish: config/activity\_log.php

🗄️ Run the Migrations
---------------------

[](#️-run-the-migrations)

Apply the database changes:

```
php artisan migrate

```

---

Log Options
-----------

[](#log-options)

The LogOptions class defines how logging should behave for a given model.

### logAll()

[](#logall)

Logs all available attributes of the model.

~ Priority - 0

```
public function logAll(): LogOptions;
```

### logOnly()

[](#logonly)

Specifies which attributes should be logged.

~ Priority - highest

```
public function logOnly(array|string $attributes): LogOptions;
```

### logExcept()

[](#logexcept)

Excludes specific attributes from being logged. If used together with ***logOnly()***, this will explicitly remove the specified attributes from the logging list.

~ Priority - highest

```
public function logExcept(array|string $attributes): LogOptions;
```

### dontLogTimestamps()

[](#dontlogtimestamps)

Disables logging of the default timestamp columns (created\_at and updated\_at). This is useful if you do not want timestamp changes to appear in the activity log.

~ Priority: 1

```
public function dontLogTimestamps(): LogOptions;
```

### logOnlyDirty()

[](#logonlydirty)

Enables logging of only the attributes that have changed (dirty attributes) during a model update. This helps reduce unnecessary log entries by excluding unchanged attributes.

~ Priority: 3

```
public function logOnlyDirty(): LogOptions;
```

### logFillable()

[](#logfillable)

Restricts logging to only the attributes defined in the model’s $fillable property. This is helpful when you want to ensure that only mass-assignable attributes are logged.

~ Priority: 2

```
public function logFillable(): LogOptions;
```

Logging with Batch
==================

[](#logging-with-batch)

**LogBatch** class can be used for logging the pile of model which use **SimpleLog** trait with a uuid batch id.

```
function example()
{

    LogBatch::start();

    ExampleClass::create([ // will log for 'created' event
        'foo' => 'bar'
    ]);

    ExampleClassTwo::create([ // will not log if not use 'SimpleLog' trait
        'bar' => 'foo'
    ]);

    LogBatch::end();
}
```

**Note:** **LogBatch** start and end methods can be used with database transaction. It is done by env value or config.

```
DB_TRANSACTION_ON_LOG=true

// or

'db_transaction_on_log' => env('DB_TRANSACTION_ON_LOG', false),
```

Use of Logging with DB transaction on
=====================================

[](#use-of-logging-with-db-transaction-on)

```
try{

    LogBatch::start();

    ExampleClass::create([ // will log for 'created' event
        'foo' => 'bar'
    ]);

    ExampleClassTwo::create([ // will not log if not use 'SimpleLog' trait
        'bar' => 'foo'
    ]);

    LogBatch::end();
}catch(\Exception $e){

    LogBatch::rollback();

}
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance65

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.6% of commits — single point of failure

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 ~9 days

Recently: every ~0 days

Total

8

Last Release

210d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00342fefdc74d266ef828c610965a169518ceba107048b73a62672bdc4c69cc9?d=identicon)[picoinno](/maintainers/picoinno)

---

Top Contributors

[![Zai185](https://avatars.githubusercontent.com/u/86978374?v=4)](https://github.com/Zai185 "Zai185 (28 commits)")[![paingsoeko](https://avatars.githubusercontent.com/u/97599513?v=4)](https://github.com/paingsoeko "paingsoeko (1 commits)")

### Embed Badge

![Health badge](/badges/pico-inno-simplelog/health.svg)

```
[![Health](https://phpackages.com/badges/pico-inno-simplelog/health.svg)](https://phpackages.com/packages/pico-inno-simplelog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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