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 3d 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 27% 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

2240d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fb4bb996611914fba924d0b7c1ddc93eadc34bbd0eb119422dc067f619e5e5c?d=identicon)[overlu](/maintainers/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.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)
