2017 © Pedro Peláez
 

library sqs-logger

send logging data to AWS SQS, working on Laravel.

image

matchingood/sqs-logger

send logging data to AWS SQS, working on Laravel.

  • Thursday, September 14, 2017
  • by kota-inamori
  • Repository
  • 12 Watchers
  • 3 Stars
  • 3,531 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

SQSLogger

Loggin library for Laravel application with AWS SQS, (*1)

Install

In your composer.json,, (*2)

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

Then you register SQSLogger at config/app.php., (*3)

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

You can create the configuration file to execute, (*4)

$ php artisan vendor:publish

Then you can configure app/sqslogger.php, (*5)

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., (*6)

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

SQS

SQSLogger sends json data to SQS in the production environment., (*7)

{
    "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., (*8)

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

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

The Versions

14/09 2017

dev-master

9999999-dev

send logging data to AWS SQS, working on Laravel.

  Sources   Download

The Requires

 

07/09 2016

v0.1

0.1.0.0

send logging data to AWS SQS, working on Laravel.

  Sources   Download

The Requires