PHP code example of olivefm / laravel-sls

1. Go to this page and download the library: Download olivefm/laravel-sls library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

olivefm / laravel-sls example snippets


Lokielse\LaravelSLS\LaravelSLSServiceProvider::class

$app->configure("sls");

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

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