hollisho/lumen-sls 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hollisho/lumen-sls

最新稳定版本:1.1.1

Composer 安装命令:

composer require hollisho/lumen-sls

包简介

Aliyun SLS Log For Lumen

README 文档

README

Install

Via Composer

$ composer require hollisho/lumen-sls

Config

Add following service providers into your providers array in bootstrap/app.php

$app->configure('sls');
$app->register(hollisho\lumensls\LumenSLSServiceProvider::class);

Add following service providers into your providers array in config/logging.php

'sls' => [
    'driver' => 'daily',
    'path' => storage_path('logs/lumen.log'),
    'tap' => [\hollisho\lumensls\Logging\SLSFormatter::class],
    'level' => 'debug',
    'days' => 1,
],

Edit your .env file

LOG_CHANNEL=sls

ALI_LOGSTORE_ENDPOINT=xxxxxxxx
ALI_LOGSTORE_ACCESS_KEY_ID=xxxxxxxx
ALI_LOGSTORE_ACCESS_KEY_SECRET=xxxxxxxx
ALI_LOGSTORE_PROJECT_NAME=my-project
ALI_LOGSTORE_NAME=test-store

You should update ALI_LOGSTORE_ENDPOINT to internal endpoint in production mode

Run php artisan lumen-sls:publish-config to publish configs (config/sls.php)

Make configuration changes if needed

Usage

First create a project and store at Aliyun SLS Console

Then update ALI_LOGSTORE_ENDPOINT, ALI_LOGSTORE_PROJECT_NAME, ALI_LOGSTORE_NAME in .env

Push a test message to queue

Log::info('Test Message', ['myname'=>'hollis']);

//or you can use `app('sls')` 

app('sls')->putLogs([
	'type' => 'test',
	'message' => json_encode(['This should use json_encode'])
]);

//or you can use `SLSLog` directly 

SLSLog::putLogs([
	'type' => 'test',
	'message' => json_encode(['This should use json_encode'])
]);

统计信息

  • 总下载量: 397
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固