PHPackages                             kitty168/think-log-driver - 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. kitty168/think-log-driver

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

kitty168/think-log-driver
=========================

require think-log-driver

v1.0.5(5y ago)221MITPHPPHP &gt;=5.6.0

Since Jun 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kitty168/think-log-driver)[ Packagist](https://packagist.org/packages/kitty168/think-log-driver)[ RSS](/packages/kitty168-think-log-driver/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (6)Used By (0)

think-log-driver
================

[](#think-log-driver)

think-log-driver

依赖
--

[](#依赖)

适用于`thinkphp5.1.*`php: &gt;=5.6

安装
--

[](#安装)

1. 安装`think-log-driver`

```
composer require kitty168/think-log-driver
```

使用
--

[](#使用)

1. 更改配置
    在`config/log.php` 中的配置修改

```
// 日志记录方式
'type'        => 'LogDb',
// 大于0.5秒的sql将被记录
'slow_sql_time' => 0.5,
// 记录日志的数据库配置，即在database.php中的key
// 如果设置该值为'default'，则使用系统数据库的实例
'log_db_connect' => 'log_db',
// 记录慢日志查询的数据表名
'log_table' => 'slow_sql',
// 忽略的操作，在以下数据中的操作不会被记录
'log_action_filters' => [
    // 'index/Index/lst'
],
```

2. 创建数据库
    用于记录日志的mysql数据表,如果使用mongodb则无需创建

```
CREATE TABLE `log_slow_sql` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`host` CHAR(200) NOT NULL DEFAULT '',
	`uri` CHAR(200) NOT NULL DEFAULT '',
	`ip` CHAR(50) NOT NULL DEFAULT '',
	`method` CHAR(50) NOT NULL DEFAULT '',
	`module` CHAR(30) NOT NULL DEFAULT '',
	`controller` CHAR(30) NOT NULL DEFAULT '',
	`action` CHAR(50) NOT NULL DEFAULT '',
	`create_time` INT(11) NOT NULL DEFAULT '0',
	`create_date` DATETIME NULL DEFAULT NULL,
	`runtime` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000',
	`sql_list` TEXT NULL,
	`sql_source` TEXT NULL,
	PRIMARY KEY (`id`),
	INDEX `rumtime` (`runtime`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;
```

更新日志
----

[](#更新日志)

v1.0.5 (2020-6-9)
-----------------

[](#v105-2020-6-9)

- php版本修复

v1.0.3 (2020-6-9)
-----------------

[](#v103-2020-6-9)

- 修复mongoDb存储格式

v1.0.2 (2020-6-8)
-----------------

[](#v102-2020-6-8)

- 版本调整

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Total

5

Last Release

2115d ago

PHP version history (2 changes)v1.0.0PHP ^5.6.0

v1.0.5PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/68d2718b0db58e1a4af5384cd03d08f882d1f1e8827ab78ec4c317ef94732eea?d=identicon)[kitty.cheng](/maintainers/kitty.cheng)

---

Top Contributors

[![kitty168](https://avatars.githubusercontent.com/u/29219271?v=4)](https://github.com/kitty168 "kitty168 (29 commits)")

### Embed Badge

![Health badge](/badges/kitty168-think-log-driver/health.svg)

```
[![Health](https://phpackages.com/badges/kitty168-think-log-driver/health.svg)](https://phpackages.com/packages/kitty168-think-log-driver)
```

###  Alternatives

[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[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)[open-telemetry/api

API for OpenTelemetry PHP.

1833.0M214](/packages/open-telemetry-api)[codemix/yii2-streamlog

A Yii 2 log target for streams in URL format

531.4M6](/packages/codemix-yii2-streamlog)

PHPackages © 2026

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