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

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

xiegaosheng/think-log-driver
============================

这是thinkphp6.0日志驱动

1.0.0(4y ago)07MITPHPPHP &gt;=7.1.0

Since Dec 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xgs736214763/think-log-driver)[ Packagist](https://packagist.org/packages/xiegaosheng/think-log-driver)[ Docs](https://github.com/xgs736214763/think-log-driver)[ RSS](/packages/xiegaosheng-think-log-driver/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

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

[](#think-log-driver)

thinkphp6的日志驱动支持elastic和mysql，mongodb

es配置
====

[](#es配置)

- es.php

```
return [
'hosts'=> explode(',',env('ELASTIC.HOST')),//切割多个
'prefix'=>env('ELASTIC.PREFIX','test_'),//
'user'=>env('ELASTIC.USERNAME'),//es的用户名
'passwd'=>env('ELASTIC.PASSWORD'),//es的密码
];

```

- log.php

```
如果使用es type= \think\log\driver\ElasticLog::class
如果使用数据库或者mongo
type= \think\log\driver\DbLog::class
//写入数据库的表名
'table' => 'logs',
'db_type' => 'mongo', //默认是default

```

- 创建数据表

```
CREATE TABLE `logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`log` varchar(2000) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '日志',
`type` varchar(55) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '类型',
`runtime` float(8,0) DEFAULT NULL COMMENT '执行事件',
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

1619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c1fca1852d0dbffaec293c31d6edfce6375350b0d3c0742398f537f0f5cc2c8?d=identicon)[xgs736214763](/maintainers/xgs736214763)

---

Top Contributors

[![xgs736214763](https://avatars.githubusercontent.com/u/22212275?v=4)](https://github.com/xgs736214763 "xgs736214763 (16 commits)")

---

Tags

logthinkphpthink-log-driver

### Embed Badge

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

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

###  Alternatives

[monolog/monolog

Sends your logs to files, sockets, inboxes, databases and various web services

21.4k964.9M7.0k](/packages/monolog-monolog)[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[symfony/monolog-bundle

Symfony MonologBundle

2.9k249.1M1.6k](/packages/symfony-monolog-bundle)[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)

PHPackages © 2026

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