ThinkPHP 6 阿里云日志服务日志驱动

think-aliyunsls

ThinkPHP 6 阿里云日志服务日志驱动

Github:https://github.com/TLingC/think-aliyunsls

安装

composer require tlingc/think-aliyunsls

配置

config/log.php

// 默认日志记录通道
'default'      => 'aliyunsls',
// 日志通道列表
'channels'     => [
    'aliyunsls' => [
        // 日志记录方式
        'type' => 'Aliyunsls',
        // 阿里云 endpoint
        'endpoint' => 'http://cn-beijing.sls.aliyuncs.com/',
        // 阿里云 AccessKey ID
        'access_key_id' => '',
        // 阿里云 AccessKey Secret
        'access_key_secret' => '',
        // 项目名称
        'project' => '',
        // logstore 名称
        'logstore' => '',
        // source 标识
        'source' => '',
        // topic 标识
        'topic' => '',
        // 日志处理
        'processor' => null,
        // 关闭通道日志写入
        'close' => false,
        // 使用JSON格式记录
        'json' => true,
        // 是否实时写入
        'realtime_write' => false,
    ],
]

协议

MIT

原文:https://tlingc.com/2020/03/thinkphp-6-%e9%98%bf%e9%87%8c%e4%ba%91%e6%97%a5%e5%bf%97%e6%9c%8d%e5%8a%a1%e6%97%a5%e5%bf%97%e9%a9%b1%e5%8a%a8/

你可能感兴趣的:(ThinkPHP 6 阿里云日志服务日志驱动)