clog / clog
There is no license information available for the latest version (1.0.1) of this package.
1.0.1
2020-09-27 08:34 UTC
Requires
- monolog/monolog: 1.24.0
- sentry/sentry: 1.10.0
This package is auto-updated.
Last update: 2024-04-17 08:45:46 UTC
README
设置私有composer镜像源
composer config repo.packagist composer http://composer.xxx.xxx
引入Clog composer包
方法1
composer require clog/clog
方法2
"require": { "clog/clog": "1.*" }
用例示范
public function test_demo() { $env = "test"; $caller = "Clogtest"; $clog = \Clog\Clog::ins($env, $caller); // 添加日志记录 $testdata = [ "msg" => "错误", "err_code" => 10000, "time_stamp" => time(), "extra" => "" ]; $r = $clog->Log($testdata, "ERROR"); $this->assertTrue($r); }
msg需要被记录的信息,以数组传递 "INFO" 日志级别 默认INFO ("DEBUG","INFO","NOTICE","WARNING","ERROR","CRITICAL","ALERT","EMERGENCY")