PHPackages                             dshibin/debuglog - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. dshibin/debuglog

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

dshibin/debuglog
================

a library of php debug

1.0.1(6y ago)16Apache License 2.0PHPPHP &gt;=7.2

Since Jan 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dshibin/debuglog)[ Packagist](https://packagist.org/packages/dshibin/debuglog)[ RSS](/packages/dshibin-debuglog/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

debuglog
--------

[](#debuglog)

```
一个简单的php埋点记录插件，使用后设置对应的参数值，就能在线上追踪代码的运行的流程。

```

\###使用方法 //引入记录装饰类 use DebugLog\\Log\\LogDecorate;

```
//Db记录
//记录Db运行时间
$st = microtime();
//mysql运行流程
...
LogDecorate::Db('select * from test',$st,microtime());

//redis记录
//记录redis运行时间
$st = microtime();
//redis运行流程
...
LogDecorate::Redis('get key',$st,microtime());

//http记录
//记录http运行时间
$st = microtime();
//http curl远程运行流程
...
LogDecorate::Http('curl baidu',$st,microtime());

//埋点info记录，可以记录自己想要的信息
//记录info运行时间
$st = microtime();
//埋点运行流程
...
LogDecorate::Info('test_key',$st,microtime());

```

### 显示方法

[](#显示方法)

```
//引入记录装饰类
use DebugLog\Log\LogDecorate;
//通过show方法会直接显示出来
LogDecorate::Show()
//不过现在的框架很多都对显示做了过滤，也可以使用框架内置的显示方法，将记录的信息显示
//获取记录的信息的方法
LogDecorate::getLog()

```

### 配置项

[](#配置项)

```
在Conf里面的所有数组格式的配置信息都会自动加载

```

### 显示结果

[](#显示结果)

#### HTML

[](#html)

```
DebugLog showViews.total process time : 70.727 ms
db total count is 2 , total time is 70.63 ms
35.549 ms : SHOW FULL COLUMNS FROM `pre_common_member`
35.081 ms : SELECT * FROM `pre_common_member` WHERE `uid` = :ThinkBind_1_859473681_ LIMIT 1 {"ThinkBind_1_859473681_":[1,1]}
redis total count is 2 , total time is 0.097 ms
0.06 ms : setex_b ["b",654,3600]
0.037 ms : get_b ["b"]
strace total count is 10 , total time is 0 ms
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Pipeline.php","line":59,"function":"think\\app\\{closure}","class":"think\\app\\MultiApp","object":{},"type":"->","args":[{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Pipeline.php","line":65,"function":"think\\{closure}","class":"think\\Pipeline","object":{},"type":"->","args":[{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/think-multi-app/src/MultiApp.php","line":72,"function":"then","class":"think\\Pipeline","object":{},"type":"->","args":[{}]}
0 ms : strace {"function":"handle","class":"think\\app\\MultiApp","object":{},"type":"->","args":[{},{},null]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Middleware.php","line":142,"function":"call_user_func","args":[[{},"handle"],{},{},null]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Pipeline.php","line":84,"function":"think\\{closure}","class":"think\\Middleware","object":{},"type":"->","args":[{},{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Pipeline.php","line":65,"function":"think\\{closure}","class":"think\\Pipeline","object":{},"type":"->","args":[{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Http.php","line":204,"function":"then","class":"think\\Pipeline","object":{},"type":"->","args":[{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/vendor/topthink/framework/src/think/Http.php","line":162,"function":"runWithRequest","class":"think\\Http","object":{"routePath":"/var/www/html/dshibin/topthink/route/index/"},"type":"->","args":[{}]}
0 ms : strace {"file":"/var/www/html/dshibin/topthink/public/index.php","line":20,"function":"run","class":"think\\Http","object":{"routePath":"/var/www/html/dshibin/topthink/route/index/"},"type":"->","args":[]}

```

#### JSON

[](#json)

```
{
	"db": [{
		"time": 37.604,
		"log": "SHOW FULL COLUMNS FROM `pre_common_member`",
		"data": []
	}, {
		"time": 37.519,
		"log": "SELECT * FROM `pre_common_member` WHERE `uid` = :ThinkBind_1_591995913_ LIMIT 1 ",
		"data": {
			"ThinkBind_1_591995913_": [1, 1]
		}
	}],
	"redis": [{
		"time": 0.031,
		"log": "setex_b",
		"data": ["b", 654, 3600]
	}, {
		"time": 0.025,
		"log": "get_b",
		"data": ["b"]
	}],
	"strace": [{
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Pipeline.php",
			"line": 59,
			"function": "think\\app\\{closure}",
			"class": "think\\app\\MultiApp",
			"object": {},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Pipeline.php",
			"line": 65,
			"function": "think\\{closure}",
			"class": "think\\Pipeline",
			"object": {},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/think-multi-app\/src\/MultiApp.php",
			"line": 72,
			"function": "then",
			"class": "think\\Pipeline",
			"object": {},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"function": "handle",
			"class": "think\\app\\MultiApp",
			"object": {},
			"type": "->",
			"args": [{}, {}, null]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Middleware.php",
			"line": 142,
			"function": "call_user_func",
			"args": [
				[{}, "handle"], {}, {},
				null
			]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Pipeline.php",
			"line": 84,
			"function": "think\\{closure}",
			"class": "think\\Middleware",
			"object": {},
			"type": "->",
			"args": [{}, {}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Pipeline.php",
			"line": 65,
			"function": "think\\{closure}",
			"class": "think\\Pipeline",
			"object": {},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Http.php",
			"line": 204,
			"function": "then",
			"class": "think\\Pipeline",
			"object": {},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/vendor\/topthink\/framework\/src\/think\/Http.php",
			"line": 162,
			"function": "runWithRequest",
			"class": "think\\Http",
			"object": {
				"routePath": "\/var\/www\/html\/dshibin\/topthink\/route\/index\/"
			},
			"type": "->",
			"args": [{}]
		}
	}, {
		"time": 0,
		"log": "strace",
		"data": {
			"file": "\/var\/www\/html\/dshibin\/topthink\/public\/index.php",
			"line": 20,
			"function": "run",
			"class": "think\\Http",
			"object": {
				"routePath": "\/var\/www\/html\/dshibin\/topthink\/route\/index\/"
			},
			"type": "->",
			"args": []
		}
	}]
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~2 days

Total

2

Last Release

2325d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10259668?v=4)[dshibin](/maintainers/dshibin)[@dshibin](https://github.com/dshibin)

---

Top Contributors

[![bin138](https://avatars.githubusercontent.com/u/6898078?v=4)](https://github.com/bin138 "bin138 (3 commits)")[![dshibin](https://avatars.githubusercontent.com/u/10259668?v=4)](https://github.com/dshibin "dshibin (3 commits)")

---

Tags

debugdebuglogphp

### Embed Badge

![Health badge](/badges/dshibin-debuglog/health.svg)

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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