PHPackages                             weiboad/fierysdk - 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. weiboad/fierysdk

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

weiboad/fierysdk
================

fiery APM Integrated PHP Burial SDK

0.5.4(9y ago)42447↓87.5%8[3 issues](https://github.com/weiboad/fierysdk/issues)ApachePHPPHP &gt;=5.3

Since May 25Pushed 8y ago7 watchersCompare

[ Source](https://github.com/weiboad/fierysdk)[ Packagist](https://packagist.org/packages/weiboad/fierysdk)[ Docs](https://github.com/weiboad/fierysdk)[ RSS](/packages/weiboad-fierysdk/feed)WikiDiscussions master Synced 2d ago

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

### RagnarSDK

[](#ragnarsdk)

[![Latest Stable Version](https://camo.githubusercontent.com/60d3fc80ca947a646f2b909892ec1f46655e460fc7831bea6325a7c8b3462b7f/68747470733a2f2f706f7365722e707567782e6f72672f776569626f61642f666965727973646b2f762f737461626c65)](https://packagist.org/packages/weiboad/fierysdk)[![Latest Unstable Version](https://camo.githubusercontent.com/cb5b45ae1afb03119ade036ccb14c486a388cf27f8a447a80ed2e6efadb5a424/68747470733a2f2f706f7365722e707567782e6f72672f776569626f61642f666965727973646b2f762f756e737461626c65)](https://packagist.org/packages/weiboad/fierysdk)[![License](https://camo.githubusercontent.com/7a3dc6ee7623539addf166d39023f2770f529cf8869eec4ac0196e1c6e51b46a/68747470733a2f2f706f7365722e707567782e6f72672f776569626f61642f666965727973646b2f6c6963656e7365)](https://packagist.org/packages/weiboad/fierysdk)

Other Laguage Introduce: [中文文档](./README_CN.md)

### Introduce

[](#introduce)

> - for the complex system online tracing.
> - support online debug.level log.exception and error collect.performance monitor and depend reloation picture
> - for the

### Requirement

[](#requirement)

> - PHP5.3+ with bcmath
> - charset utf-8 project

#### Step 1 Container Variable

[](#step-1-container-variable)

##### Nginx

[](#nginx)

copy the nginx/fiery\_fastcgi\_pararms -&gt; nginx/conf and edit the vhost config

```
server{
    listen 80;
    charset utf-8;
    root /path/xxx/xxx/src/public;
    server_name xxx.com;

    location /{
        index index.php index.html index.htm;
        if (-f $request_filename) {
            break;
        }
        if (-d $request_filename) {
            break;
        }
        if ($request_filename !~ (\.css|images|index\.php.*) ) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;
        }
    }

    location ~ /index.php/ {
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
        include fiery_fastcgi_params; # here is the point
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 600;
    }

    location ~ \.php$ {
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
        include fiery_fastcgi_params; # here is the point
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 600;
    }
}

```

```
# reload the nginx config
nginx -s reload

```

###### Apache

[](#apache)

```

    ServerAdmin webmaster@demo.com
    DocumentRoot "e:\wwwroot\demo"
    ServerName my.demo.com
    ErrorLog "logs/my.demo.com-error.log"
    CustomLog "logs/my.demo.com-access.log" common

    # start config the variable for fierysdk
    SetEnv RAGNAR_LOGPATH /data1/ragnar/  # here is the point
    SetEnv RAGNAR_IDC 0  # here is the point
    SetEnv RAGNAR_IP 192.168.1.123  # here is the point

        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

```

#### Fierysdk Install

[](#fierysdk-install)

Run command to get this composer

```
composer require weiboad/fierysdk

```

insert code on the bootstrap of php project

```
    require_once("vendor/autoload.php");

    use \Adinf\RagnarSDK\RagnarSDK as RagnarSDK;
    use \Adinf\RagnarSDK\RagnarConst as RagnarConst;

    //for the Temporary disable this sdk
    //RagnarSDK::disable();

    //default log level is info you can Temporary open the debug level by send header
    RagnarSDK::setLogLevel(RagnarConst::LOG_TYPE_INFO);

    //filter url
    //when the url contained parameter on path such as
    //http://wwwei.com/usr/$uid(an var alway change)/fetch
    //you must write an rule on this callback filted to http://wwwei.com/usr/releaced/fetch

    RagnarSDK::setUrlFilterCallback(function ($url, $hashquery) {
        if (trim($url) == "") {
            return "";
        }
        if (stripos($url, 'http') !== 0) {
            $url = "http://" . $url;
        }

        $urlinfo = parse_url($url);

        if(!$urlinfo){
            return $url."#PARSERERROR";
        }

        if (!isset($urlinfo["scheme"])) {
            $urlinfo["scheme"] = "http";
        }

        if (!isset($urlinfo["path"])) {
            $urlinfo["path"] = "/";
        }

        if (!isset($urlinfo["query"])) {
            $urlinfo["query"] = "";
        }

        if ($hashquery) {
            return $urlinfo["scheme"] . "://" . $urlinfo["host"] . $urlinfo["path"] . "?" . $urlinfo["query"];
        } else {
            return $urlinfo["scheme"] . "://" . $urlinfo["host"] . $urlinfo["path"];
        }
     });

    //this must run at latest
    //ragnar_projectname is you project name will use on log folder name
    RagnarSDK::init("ragnar_projectname");

    //Ragnar level log example
    // this is info log you can see this on tracing page on fiery
    RagnarSDK::RecordLog(RagnarConst::LOG_TYPE_INFO, __FILE__, __LINE__, "module1_msg", array("msg"=>"i wish i can fly!"));

    // this is debug log
    RagnarSDK::RecordLog(RagnarConst::LOG_TYPE_DEBUG, __FILE__, __LINE__, "module2_msg",array("msg"=>"i wish im rich!");

    //customize performance dig point example will display on tracing page on fiery
    //dig start
    $digpooint = RagnarSDK::digLogStart(__FILE__,__LINE__,"ragnar_test");

        //run something.....
    //dig end
    RagnarSDK::digLogEnd($digpooint,array("happy"=>1));

```

### Ragnar level log

[](#ragnar-level-log)

> - level log：set the log level to decide the customize log to dump
> - log search：all the log in the level will be show on the tracing page.
> - exception and error：will be show on the error statistic page
> - performance：a easy way the record the function cost time and make an statistics on curl mysql api

#### log level

[](#log-level)

> - LOG\_TYPE\_TRACE trace log for the low level debug
> - LOG\_TYPE\_DEBUG Debug log
> - LOG\_TYPE\_NOTICE notice log on the system
> - LOG\_TYPE\_INFO info for the tips the working status
> - LOG\_TYPE\_ERROR when the system error will record this level
> - LOG\_TYPE\_EMEGENCY emegency log that will send SMS or Email to admin
> - LOG\_TYPE\_EXCEPTION Exception log
> - LOG\_TYPE\_PERFORMENCE performance log all the dig point will use this

#### Curl dig point

[](#curl-dig-point)

curl dig point

```
    //curl must fill
    $digpooint = RagnarSDK::digLogStart(__FILE__, __LINE__, "curl");

    //curl init ....

    $nextrpcidheader = RagnarSDK::getCurlChildCallParam($digpooint);
    curl_setopt($this->ch, CURLOPT_HTTPHEADER, $nextrpcidheader);

    $result = //curl exec ...

    $ext = array("errorno" => $errno, "error" => curl_error($this->ch));
    $info = curl_getinfo($this->ch);

    //digCurlEnd($digPoint, $url, $method, $postParam, $getParam, $curlInfo, $errCode, $errMsg, $result)

    RagnarSDK::digLogEnd($digpooint, array(
                "url" => $info['url'], "method" => self::get_method(),
                "param" => array("post" => $this->post_fields, "get" => $this->query_fields),
                "info" => $info,
                "error" => $ext,
                "result" => json_decode($result,true),//must array
    );

```

#### Mysql

[](#mysql)

Mysql dig point

```
    //this for record the exception when the error
    RagnarSDK::RecordLog(\Adinf\RagnarSDK\RagnarSDK::LOG_TYPE_EXCEPTION, __FILE__, __LINE__, "mysql", array("fun" => "query", "sql" => $sql, "error" => $ex->getMessage()));

    //start monitor the performance
    $digPoint = RagnarSDK::digLogStart(__FILE__, __LINE__, "mysql");

    //do some sql execute

    //for the mysql performance dig point end
    //RagnarSDK::digLogEnd($digPoint, array("sql" => $sql, "data" => "sql的参数", "op" => "select\delete\update\...", "fun" => "execute_sql"));
    RagnarSDK::digMysqlEnd($digPoint, $sql, "sql的参数", "select\delete\update\...", "execute_sql");
    //if is error
    if(error){
        RagnarSDK::RecordLog(RagnarConst::LOG_TYPE_EXCEPTION, __FILE__, __LINE__, "mysql", array("fun" => "execute", "sql" => $sql, "error" => $error));
    }

```

### Temporary change

[](#temporary-change)

online change the log level by send header

```
    X-RAGNAR-TRACEID   traceid
    X-RAGNAR-RPCID     rpcid (spanid)
    X-RAGNAR-LOGLEVEL  log level

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~33 days

Total

2

Last Release

3291d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b2ed1ebdd56a1859252fbc7a0b2acbaffe6696883993ded27e724644df538eb?d=identicon)[xcl3721](/maintainers/xcl3721)

---

Top Contributors

[![137-rick](https://avatars.githubusercontent.com/u/1940307?v=4)](https://github.com/137-rick "137-rick (11 commits)")[![persiliao](https://avatars.githubusercontent.com/u/19988497?v=4)](https://github.com/persiliao "persiliao (1 commits)")

---

Tags

apmfieryphpfieryBurial SDK

### Embed Badge

![Health badge](/badges/weiboad-fierysdk/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

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

API for OpenTelemetry PHP.

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

SDK for OpenTelemetry PHP.

2328.5M330](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)

PHPackages © 2026

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