PHP code example of hollisho / lumen-sls

1. Go to this page and download the library: Download hollisho/lumen-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/ */

    

hollisho / lumen-sls example snippets


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

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

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