PHP code example of jarviscdr / logc-webman

1. Go to this page and download the library: Download jarviscdr/logc-webman library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jarviscdr / logc-webman example snippets


# 在插件的配置文件中修改下面的配置
'api_host'        => 'http://127.0.0.1:10001',  // 日志中心API地址
'api_timeout'     => 1.0,                       // 日志中心API请求超时时间 单位秒
'project'         => 'FantasyTech',             // 默认项目名称
'throw_exception' => false,                     // 是否抛出异常(如果为false,记录日志失败也不会抛出异常)

// 上报日志
logc(['err' => -1, 'data' => '订单请求异常', 'oid' => 1234567890], 'order,alipay', \Jarviscdr\LogcWebman\LogcConstant::INFO);