New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

lokielse/laravel-sls

Aliyun SLS Log For Laravel
3,692 21

Larablocks Analysis

lokielse/laravel-sls works with Laravel 5 (latest release v1.0.0, Jul 22, 2016), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Jul 22, 2016)
  • 0 downloads a month (needs 10,000)
  • 21 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 22, 2016.
  • No releases in the last 12 months.
  • First released: Jul 22, 2016.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require lokielse/laravel-sls
Latest Version:v1.0.0
PHP:~5.5|~7.0
Laravel:5
License:MIT
Last Updated:Mar 7, 2019
Links: GitHub  ·  Packagist
Maintainer: waisir

Aliyun SLS Log For Laravel

Latest Version on Packagist Software License Total Downloads

Install

Via Composer

$ composer require lokielse/laravel-sls

Config

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

Lokielse\LaravelSLS\LaravelSLSServiceProvider::class

Publish sls.php to config folder

php artisan vendor:publish --provider="Lokielse\LaravelSLS\LaravelSLSServiceProvider" 

Replace Log alias in your config/app.php (Optional)

//'Log'               => Illuminate\Support\Facades\Log::class,
'Log'                 => Lokielse\LaravelSLS\Facades\WriterFacade::class,
'SLSLog'              => Lokielse\LaravelSLS\Facades\LogFacade::class,

Edit your .env file

ALIYUN_ACCESS_KEY_ID=...
ALIYUN_ACCESS_KEY_SECRET=...
# https://help.aliyun.com/document_detail/29008.html
# 如杭州公网 cn-hangzhou.log.aliyuncs.com
# 如杭州内网 cn-hangzhou-intranet.log.aliyuncs.com
SLS_ENDPOINT=cn-hangzhou.log.aliyuncs.com
SLS_PROJECT=test-project
SLS_STORE=test-store

You should update SLS_ENDPOINT to internal endpoint in production mode

Usage

First create a project and store at Aliyun SLS Console

Then update SLS_ENDPOINT, SLS_PROJECT, SLS_STORE in .env

Push a test message to queue

Log::info('Test Message', ['foobar'=>'2003']);

//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'])
]);

Security

Create RAM access control at Aliyun RAM Console

  1. Create a custom policy such as AliyunSLSFullAccessFoobar

    {
      "Version": "1",
      "Statement": [
    	{
    	  "Action": "log:*",
    	  "Resource": [
    		"acs:log:*:*:project/test-project/logstore/test-store",
    	  ],
    	  "Effect": "Allow"
    	}
      ]
    }
    
  2. Create a user for you app such as foobar

  3. Assign the policy AliyunSLSFullAccessFoobar to the user foobar

  4. Create and get the AccessKeyId and AccessKeySecret for user foorbar

  5. update QUEUE_SLS_ACCESS_KEY and QUEUE_SLS_ACCESS_SECRET in .env

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

hollisho/lumen-sls

Aliyun SLS Log For Lumen

397 0
lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

14,876 26
alexusmai/kafka-log-driver

Laravel, log driver for Kafka

3,087 2
latrell/aliyun-sls-laravel

Aliyun simple log service (SLS) SDK in Laravel5 package.

725 0
aijiasoft/aliyun

aliyun SDK for laravel

11 0

Version History

Version Released PHP Laravel License
v1.0.0 ~5.5|~7.0 ~5.1 MIT