matchingood/sqs-logger 问题修复 & 功能扩展

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

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

matchingood/sqs-logger

Composer 安装命令:

composer require matchingood/sqs-logger

包简介

send logging data to AWS SQS, working on Laravel.

README 文档

README

Loggin library for Laravel application with AWS SQS

Install

In your composer.json,

"matchingood/sqs-logger": "^0.1"

Then you register SQSLogger at config/app.php.

'providers' => [
    .
    .
    .
    Matchingood\SQSLogger\SQSLoggerServiceProvider::class
],
.
.
.
'aliases' => [
    .
    .
    .
    'SQSLogger' => Matchingood\SQSLogger\Facades\SQSLogger::class
],

You can create the configuration file to execute

$ php artisan vendor:publish

Then you can configure app/sqslogger.php

return [
    'env' => "if not 'prod', this library use Laravel Log class",

    'aws' => [
        'access_key' => "AWS access key",
        'access_secret' => "AWS access secret",
        'sqs' => [
            'version' => "API version",
            'region' => "AWS region",
            'queue_name' => "SQS queue name"
        ]
    ]
];

Usage

SQSLogger::info("info");
SQSLogger::error("error");
SQSLogger::critical("critical");

// Illuminate\Http\Request
SQSLogger::access($request);

You can add more information like this.

SQSLogger::info('info', ['hello' => 'world']);

SQS

SQSLogger sends json data to SQS in the production environment.

{
    "level": "INFO",
    "time": "2016-09-07 17:30:00",
    "userId": 1,
    "message": "Hello World!"
}

The userId property will be -1 when Auth::check() returns false.

Only ACCESS level sends diferent json data, using Illuminate\Http\Request as a parameter.

{
    "level": "INFO",
    "time": "2016-09-07 17:30:00",
    "userId": 1,
    "method": "POST",
    "accessUrl": "https://github.com/matchingood"
}

统计信息

  • 总下载量: 4.11k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 12
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-09-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固