PHP code example of aviationcode / laravel-ecs-logging

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

    

aviationcode / laravel-ecs-logging example snippets


return [
    'channels' => [
        // ... Other channels

        'ecs' => [
            'driver' => 'ecs',
            'path' => storage_path('logs/ecs/laravel.json'),
            'level' => 'debug',
            'days' => 14,
        ],
    ]
];

Log::info('Password changed for John Doe<[email protected]>', [
    'event' => [
        'action' => 'user-password-change',
        'code' => 4648,
        'outcome' => \AviationCode\EcsLogging\Types\Event::OUTCOME_SUCCESS,
        'type' => 'user',
    ],
]);
bash
php artisan vendor:publish --provider="AviationCode\EcsLogging\EcsLoggingServiceProvider" --tag="config"