aliyun-sdk-project / php-log
该软件包的最新版本(1.2)没有可用的许可证信息。
1.2
2024-07-17 05:39 UTC
Requires
- monolog/monolog: ^1.12 | ~2.0
This package is not auto-updated.
Last update: 2024-09-25 06:52:48 UTC
README
以前阿里云的日志功能不太好使用,无法用composer管理,不方便,所以编写了一个composer包进行管理,现在支持框架
- Yii2
- lavarel
安装
composer require aliyun-sdk-project/php-log
Yii2 配置
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'AliyunPHPLog\Yii2LogTarget',
'levels' => ['error', 'warning', 'info'],
'config' => [
'endpoint' => 'http://cn-hangzhou.log.aliyuncs.com/',
'accessKeyId' => '',
'accessKey' => '',
'project' => '',
'logstore' => '',
],
],
],
],
project 是创建日志的项目名称。logstore 存储名称
Lavarel 配置
'aliyun' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => AliyunPHPLog\LaravelLogHandler::class,
'handler_with' => [
'endpoint' => env('ALIYUN_ENDPOINT', 'http://cn-shenzhen.log.aliyuncs.com/'),
'accessKeyId' => '',
'accessKey' => '' ,
'project' => '',
'logstore' => '',
],
],