PHPackages                             itd/itd-db-logger - 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. itd/itd-db-logger

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

itd/itd-db-logger
=================

022PHP

Since Nov 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/itd888/itd-db-logger)[ Packagist](https://packagist.org/packages/itd/itd-db-logger)[ RSS](/packages/itd-itd-db-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

需要在根目录下.env 配置数据库日志的连接

使用例子: MMLog::createMoment('test2', 2); MMLog::addContent('content1', 'title'); MMLog::addContent(\['content2' =&gt; \[1, 2, 3\], 'content3' =&gt; \[3, 4, 5\]\], 'title'); MMLog::addContent($oddsTennis, '$oddsTennis'); MMLog::flush();

\[DL\] DB\_HOST = 127.0.0.1 DB\_USER = username DB\_PASS = password DB\_NAME = itd\_logger DB\_PORT = 3306 LOG\_LEVEL = 1 #1.debug 2.info 3.warning 4.error 5.fatal

手动创建上述的DB\_NAME相同名字的数据库(db\_logger),再创建以下表

CREATE TABLE `itd_logger`.`_db_log` ( `id` int(11) NOT NULL, `project` varchar(20) NOT NULL, `log_type` varchar(20) NOT NULL, `title` varchar(1000) NOT NULL, `content` text NOT NULL, `record_date` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据库日志表'; ALTER TABLE `_db_log` ADD PRIMARY KEY (`id`); ALTER TABLE `_db_log` MODIFY `id` int(11) NOT NULL AUTO\_INCREMENT; COMMIT;

CREATE TABLE IF NOT EXISTS `itd_logger`.`_moment_log` ( `id` int(11) NOT NULL AUTO\_INCREMENT, `project` varchar(20) NOT NULL, `moment_name` varchar(20) NOT NULL, `title` varchar(1000) NOT NULL, `content` text NOT NULL, `record_date` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据库瞬间日志表';

CREATE TABLE `itd_logger`.`_moment_interval` ( `id` INT NOT NULL AUTO\_INCREMENT PRIMARY KEY , `project` VARCHAR( 100 ) NOT NULL COMMENT '项目', `moment_name` VARCHAR( 200 ) NOT NULL COMMENT '瞬间的标签', `update_time` DATETIME NOT NULL COMMENT '更新时间', INDEX ( `project` , `moment_name` ) ) ENGINE = INNODB COMMENT = '瞬间间隔表';

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1a3008127a714fe6b41c3be55d8b3c0ce7949eab8f89f7752ab15486ee40887?d=identicon)[itd888.work@gmail.com](/maintainers/itd888.work@gmail.com)

---

Top Contributors

[![itd888](https://avatars.githubusercontent.com/u/145648853?v=4)](https://github.com/itd888 "itd888 (28 commits)")

### Embed Badge

![Health badge](/badges/itd-itd-db-logger/health.svg)

```
[![Health](https://phpackages.com/badges/itd-itd-db-logger/health.svg)](https://phpackages.com/packages/itd-itd-db-logger)
```

###  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)
