PHPackages                             urumuqi/dblog - 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. urumuqi/dblog

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

urumuqi/dblog
=============

laravel common log, save log to db

v0.0.7(5y ago)0102MITPHP

Since Jun 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Urumuqi/laravel-db-log)[ Packagist](https://packagist.org/packages/urumuqi/dblog)[ RSS](/packages/urumuqi-dblog/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (7)Used By (0)

urumuqi/dblog
=============

[](#urumuqidblog)

this library provider 2 methods, and let can write and read log.

`Log` service has been register into laravel service container as `singleton`.

Keep Code As Simple As Possible.

read &amp; write definition:

```
/**
 * save log content.
 *
 * @param string $bizTag
 * @param string $actionTag
 * @param array  $content
 * @param string $operator
 * @param string $traceKey
 *
 * @return boolean
 */
public function write($bizTag, $actionTag, array $content, $operator = '', $traceKey = '')

/**
 * read log.
 *
 * @param string  $bizTag
 * @param string  $actionTag
 * @param string  $traceKey
 * @param string  $operator
 * @param integer $pageNum
 * @param integer $pageSize
 * @param boolean $asc      true order by asc ｜ false order by desc
 *
 * @return array
 */
public function read($bizTag, $actionTag = '', $traceKey = '', $operator = '', $pageNum = 1, $pageSize = 15, $asc = true)

/**
 * read log content by trace_key.
 *
 * @param string  $traceKey
 * @param integer $pageNum
 * @param integer $pageSize
 * @param boolean $asc      asc or desc
 *
 * @return array
 */
public function readByTraceKey($traceKey, $pageNum = 1, $pageSize = 15, $asc = true)

/**
 * read by biz_tag.
 *
 * @param string  $bizTag
 * @param integer $pageNum
 * @param integer $pageSize
 * @param boolean $asc
 *
 * @return array
 */
public function readByBizTag($bizTag, $pageNum = 1, $pageSize = 20, $asc = true)

/**
 * read by biz_tag and trace_key.
 *
 * @param string  $bizTag
 * @param string  $traceKey
 * @param integer $pageNum
 * @param integer $pageSize
 * @param boolean $asc
 *
 * @return void
 */
public function readByBizTraceKey($bizTag, $traceKey, $pageNum = 1, $pageSize = 20, $asc = true)

/**
 * read by operator.
 *
 * @param string  $operator
 * @param string  $bizTag
 * @param integer $pageNum
 * @param integer $pageSize
 * @param boolean $asc
 *
 * @return array
 */
public function readByOperator($operator, $bizTag = '', $pageNum = 1, $pageSize = 20, $asc = true)

/**
 * 根据条件查询日志.
 *
 * @param array   $cond
 * @param boolean $asc
 *
 * @return array
 */
public function queryLogByCond(array $cond, $asc = true)

/**
 * 返回结构.
 */
$pageResult = [
    'data' => [],
    'total' => 10,
];
```

involved in laravel
-------------------

[](#involved-in-laravel)

```
composer require urumuqi/dblog
```

config/app.php add `LogProvider`

```
'providers' => [
    Urumuqi\DbLog\LogProvider::class,
],
```

Run migrate, create dblog table

```
php artisan migrate
```

usage
-----

[](#usage)

```
$dblog = app('dblog');
$bizTag = 'dblogtest';
$actionTag = 'new';
$logContent = [
    'package' => 'urumuqi/dblog',
    'author' => 'urumuqi',
    'email' => 'wuqi226@gmail.com',
    'create_date' => date('Y-m-d H:i:s'),
];
$operator = 'urumuqi';
$traceKey = 'dblog';
$saveRs = $dblog->write($bizTag, $actionTag, $logContent, $operator, $traceKey);
$readRs1 = $dblog->read($bizTag);
$readRs2 = $dblog->readByTraceKey($traceKey);
$readRs3 = $dblog->readByBizTag($bizTag);
$readRs4 = $dblog->readByBizTraceKey($bizTag, $traceKey);
$readRs5 = $dblog->readByOperator($operator);
dd($saveRs, $readRs1, $readRs2, $readRs3, $readRs4, $readRs5);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~35 days

Total

6

Last Release

1984d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4262dfe3b44bbc5fb4faebacc5ca742e4f236ed98c5202a3b43f90bb244f1c?d=identicon)[urumuqi](/maintainers/urumuqi)

---

Top Contributors

[![Urumuqi](https://avatars.githubusercontent.com/u/4235526?v=4)](https://github.com/Urumuqi "Urumuqi (24 commits)")

### Embed Badge

![Health badge](/badges/urumuqi-dblog/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/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.2M138](/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)
