PHP code example of rouxtaccess / laravel-cloudwatch

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

    

rouxtaccess / laravel-cloudwatch example snippets


'channels' => [

    'stack' => [
        'driver' => 'stack',
        'channels' => explode(',', env('LOG_STACK', 'daily,cloudwatch')),
    ],

    'cloudwatch' => [
        'driver' => 'cloudwatch',
        'level' => env('LOG_CLOUDWATCH_LEVEL', 'info'),
    ],

],

Log::info('Order shipped', ['order_id' => $order->id]);
Log::channel('cloudwatch')->warning('Only to CloudWatch');

Schedule::command('cloudwatch:ship')->everyMinute()->withoutOverlapping();

'cloudwatch' => [
    'driver' => 'cloudwatch',
    'level' => 'info',
    'formatter' => Monolog\Formatter\LineFormatter::class,
],

'buffer' => [
    'implementation' => App\Logging\NativeRedisListBuffer::class,
],
bash
php artisan vendor:publish --tag="cloudwatch-config"
dotenv
CLOUDWATCH_CREATE_LOG_GROUP=false