PHPackages                             overlu/loghub-sdk - 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. overlu/loghub-sdk

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

overlu/loghub-sdk
=================

loghub sdk

1.0.0(6y ago)03MITPHP

Since Mar 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/overlu/loghub_sdk)[ Packagist](https://packagist.org/packages/overlu/loghub-sdk)[ RSS](/packages/overlu-loghub-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

### 日志中心SDK

[](#日志中心sdk)

#### Usage

[](#usage)

```
composer require overlu/loghub-sdk
```

##### 相关配置

[](#相关配置)

1. 先在.env文件配置LOGHUB\_HUB以及APP\_CODE等参数（后续根据配置中心，自动添加更新）

```
LOGHUB_VERSION=1.0.1
SITE_ID=89
APP_CODE=mxu
LOGHUB_SERVER=http://loghub.test
```

2. 使用

#### 操作日志

[](#操作日志)

```
/**
 * @param $type : 操作日志 insert,update,delete
 * @param $content_before : 操作前的数据, array
 * @param $content_after : 操作的数据, array
 * @param $table : 操作的数据表, string
 * @param $owner : 操作人[id,name], array
 * @param $remark : 备注说明, string
 */
\Overlu\Log\Log::operation($type, $content_before, $content_after, $table, $owner, $remark);
```

##### Demo

[](#demo)

```
\Overlu\Log\Log::operation(
    'update',
    ['id' => 1, 'name' => 'lupeng'],
    ['name' => '陆鹏'],
    'user',
    ['id' => 9, 'name' => 'admins'],
    '更新用户名'
);
```

#### 错误日志

[](#错误日志)

```
/**
 * @param \Exception $exception
 */
\Overlu\Log\Log::error(\Exception $exception);
```

##### Demo

[](#demo-1)

```
try {
    do something...
} catch (Exception $exception) {
    \Overlu\Log\Log::error($exception);
}
```

#### 普通日志

[](#普通日志)

```
/**
 * @param $store_code : 日志库编码, string
 * @param $content : 内容, array
 * @param string $type : 日志级别: debug,info(默认),notice,warning,error,alert
 */
\Overlu\Log\Log::push($store_code, $content, $type);
```

##### Demo

[](#demo-2)

```
\Overlu\Log\Log::push('store1', ['message'=>'who do something'], 'info');
\Overlu\Log\Log::push('store2', ['message'=>'who do something error'], 'warning');
\Overlu\Log\Log::push('store3', ['message'=>'something bad'], 'alert');
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

2290d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/overlu-loghub-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/overlu-loghub-sdk/health.svg)](https://phpackages.com/packages/overlu-loghub-sdk)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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