PHPackages                             banju/log - 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. banju/log

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

banju/log
=========

this is a log sdk

v1.3(5y ago)11.2kMITPHP

Since Jun 28Pushed 5y agoCompare

[ Source](https://github.com/buyaorewo365/log)[ Packagist](https://packagist.org/packages/banju/log)[ RSS](/packages/banju-log/feed)WikiDiscussions master Synced 3w ago

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

log
===

[](#log)

日志系统--&gt;基于seaslog的日志sdk

调用方式
====

[](#调用方式)

require('banjulog/autoload.php'); use BanjuLog\\log;

创建日志对象
======

[](#创建日志对象)

$obj=new log();

数据结构
====

[](#数据结构)

$data=\[ 'action'=&gt;'111', 'bhv\_type'=&gt;'22', 'user\_type'=&gt;'33', 'bhv\_type'=&gt;'44', 'user\_id'=&gt;'55', 'act\_obj'=&gt;'66', 'obj\_type'=&gt;'77', 'event'=&gt;'88', 'trace\_id'=&gt;'99', 'bhv\_datetime'=&gt;'100', 'pos\_type'=&gt;'101', 'position'=&gt;'102', 'env'=&gt;'103', 'plates'=&gt;'104' \];

设置时间戳格式
=======

[](#设置时间戳格式)

-&gt;setDateFormat('YmdHis')

设置基础路劲
======

[](#设置基础路劲)

$res=$obj-&gt;setBasePath('/data/banjulog')

设置项目目录
======

[](#设置项目目录)

-&gt;setProject('test')

设置日志类型
======

[](#设置日志类型)

-&gt;setModule('test')

设置日志错误级别
========

[](#设置日志错误级别)

-&gt;setLevel('debug')

设置数据
====

[](#设置数据)

-&gt;setData($data)

写入日志
====

[](#写入日志)

-&gt;write();

如果返回true,写入成功
=============

[](#如果返回true写入成功)

var\_dump($res);

说明:set开头方法为设置,get开头方法为获取,如果不设置为默认php配置
======================================

[](#说明set开头方法为设置get开头方法为获取如果不设置为默认php配置)

支持链式操作
======

[](#支持链式操作)

example:
========

[](#example)

```
require('vendor/autoload.php');
use BanjuLog\log;
$obj=new log();
$data=[ 'action'=>'111', 'bhv_type'=>'22', 'user_type'=>'33', 'bhv_type'=>'44', 'user_id'=>'55', 'act_obj'=>'66', 'obj_type'=>'77', 'event'=>'88', 'trace_id'=>'99', 'bhv_datetime'=>'100', 'pos_type'=>'101', 'position'=>'102', 'env'=>'103', 'plates'=>'104' ];
$res=$obj->setProject('agent')->setModule('test')->setData($data)->write();
if($res){
    echo "日志写入成功";
}else{
    echo "日志写入失败";
}

```

具体使用参考api接口,自己看
===============

[](#具体使用参考api接口自己看)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

4

Last Release

2187d ago

### Community

Maintainers

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

---

Top Contributors

[![buyaorewo365](https://avatars.githubusercontent.com/u/24890319?v=4)](https://github.com/buyaorewo365 "buyaorewo365 (12 commits)")

### Embed Badge

![Health badge](/badges/banju-log/health.svg)

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

###  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)
