xyqweb/log
最新稳定版本:0.6.9.2
Composer 安装命令:
composer require xyqweb/log
包简介
create by wya team
README 文档
README
Run environment
- PHP 7.1+.
Install Log PHP SDK
composer require xyqweb/log
-
If you use the composer to manage project dependencies, run the following command in your project's root directory:
composer require xyqweb/logYou can also declare the dependency on Log SDK for PHP in the
composer.jsonfile."require": { "xyqweb/log": "~0.1" }Then run
composer installto install the dependency. After the Composer Dependency Manager is installed, import the dependency in your PHP code:require_once __DIR__ . '/vendor/autoload.php';
Quick use
Initialize an LogClient
Load in normal mode
<?php $log = new \xyqWeb\log\Log([ 'driver' => 'ssdb',//only accept file or ssdb 'host' => 'xx.xxx.xxx.xxx',//ssdb only 'port' => 'xxxxx',//ssdb only 'project' => 'xxx',//your project name 'key' => 'xxxx',//ssdb only 'path' => 'path'//log path ]); $log->write('test.log', ['content' => 'this is test content']); // You can add subdirectories here $log->write('test/test.log', ['content' => 'this is test content']); $log = new \xyqWeb\log\Log([ 'driver' => 'ssdb',//only accept file or ssdb 'host' => 'xx.xxx.xxx.xxx',//ssdb only 'port' => 'xxxxx',//ssdb only 'project' => 'xxx',//your project name 'key' => 'xxxx',//ssdb only 'path' => 'path'//log path ]); $log->write('test.log', ['content' => 'this is test content']); // You can add subdirectories here $log->write('test/test.log', ['content' => 'this is test content']);
Load in normal mode yii2
'components' => [ 'yiiLog' => [ 'class' => 'xyqWeb\log\YiiLog', 'config'=>[ 'driver' => 'ssdb',//only accept file or ssdb 'host' => 'xx.xxx.xxx.xxx',//ssdb only 'port' => 'xxxxx',//ssdb only 'project' => 'xxx',//your project name 'key' => 'xxxx',//ssdb only 'path' => 'path'//log path ] ] ]
Yii::$app->yiiLog->->write('test.log', ['content' => 'this is test content']); Yii::$app->yiiLog->write('test/test.log', ['content' => 'this is test content']);
统计信息
- 总下载量: 249
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-03-24